From faa9e605c21adb21e49686fdd60e9ed3ba814ceb Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Wed, 22 Mar 2017 19:38:19 +0000 Subject: [PATCH] [Android] Fix NRE on Picker (#834) --- Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs index 9587d0a..0727807 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs @@ -111,7 +111,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat _dialog.SetCanceledOnTouchOutside(true); _dialog.DismissEvent += (sender, args) => { - ((IElementController)Element).SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); + (Element as IElementController)?.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); _dialog.Dispose(); _dialog = null; }; -- 2.7.4