Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fix crash on iOS LabelRenderer (#14982)
Browse files Browse the repository at this point in the history
When the label is `TextType=Html` and the html is big, when you send the app to background change the theme and go back then the app has high changes to crash because the `Element` is `null`. So this fixes it by checking that before updating the color.
  • Loading branch information
fedemkr authored Dec 20, 2021
1 parent b331f96 commit 0eb3194
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ void UpdateFont()

void UpdateTextColor()
{
if (IsElementOrControlEmpty)
return;

if (IsTextFormatted)
{
UpdateFormattedText();
Expand Down

0 comments on commit 0eb3194

Please sign in to comment.