google/accompanist

[BottomSheetNavigator] NullPointerException (race-condition?) when using back button

alixwar opened this issue · 6 comments

Describe the bug

This is a crash reported from an analytics tool so I cannot give more details than the stacktrace and the devices where the issues were found.

To Reproduce

Steps to reproduce the behavior:

Fatal Exception: java.lang.NullPointerException:
       at com.google.accompanist.navigation.material.BottomSheetNavigator$sheetContent$1$2.invoke(BottomSheetNavigator.kt:224)
       at com.google.accompanist.navigation.material.BottomSheetNavigator$sheetContent$1$2.invoke(BottomSheetNavigator.kt:223)
       at androidx.activity.compose.BackHandlerKt$BackHandler$backCallback$1$1.handleOnBackPressed(BackHandler.kt:89)
       at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.kt:276)
       at androidx.activity.OnBackPressedDispatcher$5.invoke(OnBackPressedDispatcher.kt:134)
       at androidx.activity.OnBackPressedDispatcher$5.invoke(OnBackPressedDispatcher.kt:134)
       at androidx.activity.OnBackPressedDispatcher$Api33Impl.createOnBackInvokedCallback$lambda$0(OnBackPressedDispatcher.kt:369)
       at android.view.ViewRootImpl$NativePreImeInputStage.onProcess(ViewRootImpl.java:7558)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:7213)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:10788)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:10676)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:10632)
       at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:10926)
       at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:285)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loopOnce(Looper.java:186)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8757)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) 

Expected behavior

A clear and concise description of what you expected to happen.

Environment:

  • Android OS version: 13
  • Device: Samsung Galaxy A24
  • Accompanist version: 0.32.0

Additional context

Add any other context about the problem here.