Rg.Plugins.Popup
Rg.Plugins.Popup copied to clipboard
PopupPageRenderer crashes when popping a PopupPage from a non-popup navigator
I realize that I'm supposed to add PopupPage-inheriting objects to the PopupNavigation.Instance. I'm in the process of a very large refactor on my project, and during this refactor I need some popup pages to exist as regular pages in my app.
This seems to work fine; however, in some cases when I pop the page, I get the following exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Rg.Plugins.Popup.Droid.Renderers.PopupPageRenderer.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0006b] in C:\projects\rg-plugins-popup\src\Rg.Plugins.Popup.Droid\Renderers\PopupPageRenderer.cs:80
at Xamarin.Forms.Platform.Android.FormsViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean p0, System.Int32 p1, System.Int32 p2, System.Int32 p3, System.Int32 p4) [0x00008] in D:\a\1\s\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Release\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:198
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.39(intptr,intptr,bool,int,int,int,int)
I suspect that a few simple null checks might solve this problem, and it would enable me to use the popup pages during this refactor (which would save me lots of time).
Can we get null checks in place to solve this crash?
@vchelaru I see that you try to check windowInsets != null. But it doesn't make sense because windowInsets can not be null. it can be Android's issue.