`TypeError: Cannot read properties of null (reading 'unmount')` crash on Android when going from background to foreground · Issue #1091 · nativescript-vue/nativescript-vue · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

TypeError: Cannot read properties of null (reading 'unmount') crash on Android when going from background to foreground #1091

Closed
@dangrima90

Description

@dangrima90

I found this issue whilst investigating this NativeScript issue: NativeScript/NativeScript#8126.

The issue happens after a navigation with clearHistory: true occurs and then the user proceeds to exiting the application via the back button. I noticed that this issue seemed to only happen on Android 11 or lower, testing with Android 12 did not result in the issue.

Showcase:

418283966-822d88c6-bc85-4626-8e90-1bdc16af4b06.mov

Code of the above showcase can be found here: https://github.com/dangrima90/android-navigation-issue.

From my investigation the issue seems to be coming from here: https://github.com/nativescript-vue/nativescript-vue/blob/main/src/plugins/navigation.ts#L85-L88

Locally I managed to workaround the issue by changing the code linked above,

From:

if (!isReloading) {
  view.unmount();
  view = null;
}

To:

if (!isReloading && view) {
  view.unmount();
  view = null;
}

I could apply the fix myself, however I'm not fully aware of what this part of the code is doing so I'm hesitant to assume that just checking whether view has a value handles all use cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.