From 6fd21f62f143361bde1c15dd01d81003453da907 Mon Sep 17 00:00:00 2001 From: Jan Schwarzer Date: Fri, 10 Dec 2021 09:47:15 +0100 Subject: [PATCH] fixed github-issue #919 by doing a null check in OnElementChanged --- ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.ios.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.ios.cs b/ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.ios.cs index 18d4e0465..b00c86f2b 100644 --- a/ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.ios.cs +++ b/ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.ios.cs @@ -25,6 +25,8 @@ public static void Init() protected override async void OnElementChanged(ElementChangedEventArgs e) { + if (Element is null) return; + AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; formsView = Element;