NullReference on app minimize

Hello,

It appears that in version of Syncfusion.Xamarin.SfPopupLayout 20.2.0.38 there is a bug.

(I have been using your controls since version 17 with no issues so far.

In the app I am working on when it is minimized (OnSleep Method) a Modal is pushed to request a pin from the user.

If an SfPopup is open when it is minimized a NullReferenceException will occur on Android.

Thank you.

{System.NullReferenceException: Object reference not set to an instance of an object.

  at Syncfusion.XForms.Android.PopupLayout.VisualContainer.Current_ModalPushed (System.Object sender, Xamarin.Forms.ModalPushedEventArgs e) [0x0008b] in <65f2bf104506461b88f5afd77e7f9c0b>:0

  at Xamarin.Forms.Application.OnModalPushed (Xamarin.Forms.Page modalPage) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Application.cs:382

  at Xamarin.Forms.Application+NavigationImpl.OnPushModal (Xamarin.Forms.Page modal, System.Boolean animated) [0x00143] in D:\a\1\s\Xamarin.Forms.Core\Application.cs:459

  at MyApp.SessionManager.SetLockState (System.Boolean isLocked) [0x000d0] in C:\MyApp\UserInteraction\SessionManager.cs:309

  at MyApp .SessionManager.Lock () [0x00055] in C:\MyApp\UserInteraction\SessionManager.cs:293

  at Sal_PP_V(intptr,intptr)}


3 Replies

CK Chris Karagounis September 5, 2022 12:14 PM UTC

I have added a sample showing the issue.

Click on the button and then minimize the app, it will throw an exception.

If you go at the App.Xaml.cs and remove the await from the dostuff() the exception is gone.



Attachment: SfPopupIssue_60d2ac90.zip



SV Suja Venkatesan Syncfusion Team September 6, 2022 02:05 PM UTC

Hi Chris,

We have logged a bug report for the reported issue “[Android] System.NullReferenceException when dismissed Popup using PushModalAsync”. We will fix the issue and include the fix in our weekly NuGet which is scheduled on October 4, 2022. We will let you know once it is released with the fix. We appreciate your patience until then.

You can also track the status of the report from the below link.  


Disclaimer: The inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.

Regards,
Suja


SV Suja Venkatesan Syncfusion Team October 6, 2022 02:26 PM UTC

Hi Chris,


We have fixed the reported issue “[Android] System.NullReferenceException when dismissed Popup using PushModalAsync” and included the issue fix in our latest NuGet release update version 20.3.0.48 which is available for download (https://www.nuget.org/).   


We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance


Regards,

Suja


Loader.
Up arrow icon