From d6559d53ee43c5d7c9b37627e13d836ad6ba9c05 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Sat, 14 Sep 2019 18:40:55 -0600 Subject: [PATCH] Check if Control is ready before interacting with Native control (#7523) * Check if control is ready before setting Text * - make 7.0 compatible --- Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs index 6b1ca8d..ffdfd81 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/LabelRenderer.cs @@ -216,6 +216,9 @@ namespace Xamarin.Forms.Platform.MacOS void UpdateTextDecorations() { + if (Element == null || Control == null) + return; + if (!Element.IsSet(Label.TextDecorationsProperty)) return; @@ -350,6 +353,9 @@ namespace Xamarin.Forms.Platform.MacOS void UpdateText() { + if (Element == null || Control == null) + return; + _formatted = Element.FormattedText; if (_formatted == null && Element.LineHeight >= 0) _formatted = Element.Text; -- 2.7.4