Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] NullReferenceException when navigating #139

Open
williambuchanan2 opened this issue Oct 28, 2024 · 0 comments
Open

[iOS] NullReferenceException when navigating #139

williambuchanan2 opened this issue Oct 28, 2024 · 0 comments

Comments

@williambuchanan2
Copy link

If a bottomsheet is shown at some point, then when navigating away from that page a nullreferenceexception is thrown.

The strange thing is the error doesn't happen until the user navigates to a different page, so it feels like the clean up is going wrong. I can open and close the bottomsheet repeatedly without problem, but then when I navigate the app crashes.

If I don't open the bottomsheet then I can navigate away without problem.

I can't find a workaround for this either. The only code of mine which is in play at the time is the navigation request, which has a try catch around it, but it doesn't catch this.

At the bottom of the call stack is my call to HideOrgBottomSheet - this is not called as part of the navigate - it is actually called to dismiss the bottom sheet earlier so I don't understand why that code is still running.

Error below.

Error Type: System.NullReferenceException
Error Message: Arg_NullReferenceException
Stack Trace: at The49.Maui.BottomSheet.BottomSheet.NotifyDismissed() at UIKit.UIViewController.DismissViewController(Boolean , Action ) at The49.Maui.BottomSheet.BottomSheetHandler.Dismiss(BottomSheet view, Object request) at The49.Maui.BottomSheet.BottomSheetHandler.MapDismiss(BottomSheetHandler handler, BottomSheet view, Object request) at Microsoft.Maui.CommandMapper`2.<>c__DisplayClass6_0[[The49.Maui.BottomSheet.BottomSheet, The49.Maui.BottomSheet, Version=8.0.3.0, Culture=neutral, PublicKeyToken=null],[The49.Maui.BottomSheet.BottomSheetHandler, The49.Maui.BottomSheet, Version=8.0.3.0, Culture=neutral, PublicKeyToken=null]].b__0(IElementHandler h, IElement v, Object o) at Microsoft.Maui.CommandMapper.InvokeCore(String key, IElementHandler viewHandler, IElement virtualView, Object args) at Microsoft.Maui.Handlers.ElementHandler.Invoke(String command, Object args) at The49.Maui.BottomSheet.BottomSheet.DismissAsync(Boolean animated) at PDS.App.RedSix.Controls.RedSixMasterPage.HideOrgSelectBottomSheet()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant