From aefb694f487a83db0384a50b55f9e6b4f4436e20 Mon Sep 17 00:00:00 2001 From: Sean Sparkman Date: Thu, 8 Dec 2022 16:39:55 -0600 Subject: [PATCH] ZXingScannerViewRenderer was causing the app to crash if the view was inside a ContentView If the `ZXingScannerView` was inside of a `ContentView` instead of a `ContentPage`, the application would crash by throwing a `Java.Lang.NullPointerException`. The `Context` passed to `ZXingScannerViewRenderer` via the constructor was actually a `ContextThemeWrapper` which does not inherit from `Activity`. Therefore when it was cast in the call of the constructor of `ZXingScannerView` in the renderer on Android, a `null` would be passed for a context instead. Fixes: #943 --- ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.android.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.android.cs b/ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.android.cs index f0b993e3d..93d1a318d 100644 --- a/ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.android.cs +++ b/ZXing.Net.Mobile.Forms/ZXingScannerViewRenderer.android.cs @@ -73,7 +73,7 @@ protected override async void OnElementChanged(ElementChangedEventArgs