Skip to content

NullReferenceException in ShellContentFragment.Destroy When _shellContext Is Null #29712

@postalservice14

Description

@postalservice14

Description

A System.NullReferenceException occurs in the ShellContentFragment.Destroy method when the _shellContext field is null. This happens during the destruction of a fragment, causing the app to crash.

Stack Trace:

System.NullReferenceException: Object reference not set to an instance of an object
        at Microsoft.Maui.Controls.Platform.Compatibility.ShellContentFragment.Destroy()(unknown)
        at Microsoft.Maui.Controls.Platform.Compatibility.ShellContentFragment.OnDestroy()(unknown)
        at AndroidX.Fragment.App.Fragment.n_OnDestroy(IntPtr jnienv, IntPtr native__this)(unknown)
        at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V callback, IntPtr jnienv, IntPtr klazz)(unknown)

Steps to Reproduce

I was unable to reproduce

Link to public reproduction project repository

No response

Version with bug

9.0.50 SR5

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 9 and up

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

Labels

s/needs-reproAttach a solution or code which reproduces the issues/no-recent-activityIssue has had no recent activityt/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions