google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.34k stars 593 forks source link

[Navigation Material] Add null check for retainedEntry in BackHandler #1728

Closed Vulama closed 7 months ago

Vulama commented 8 months ago

BackHandler sometimes crashes the application with the NullPointerException. Log from the FirebaseCrashlytics:

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)

This seems to be a random issue on low-end devices.

This issue was noticed using com.google.accompanist:accompanist-navigation-material:0.32.0 on a large-scale application.

bentrengrove commented 7 months ago

Thanks for the fix! We have fixed this in a different way in #1736 so I will close this one out.