bluelinelabs / bluelinelabs/Conductor
Crash on restore with TransitionChangeHandlerCompat
- Dominant language
- Java
- Stars
- 3.9k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Description
I used `TransitionChangeHandlerCompat` like this
`TransitionChangeHandlerCompat(
TransitionScreenChangeHandler(
arrayListOf(ELEMENT_NAME)),
FadeChangeHandler()
)`
and when it try to restore state it crash with
` Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.bluelinelabs.conductor.ControllerChangeHandler.restoreFromBundle(android.os.Bundle)' on a null object reference
at com.bluelinelabs.conductor.changehandler.TransitionChangeHandlerCompat.restoreFromBundle(TransitionChangeHandlerCompat.java:72)
at com.bluelinelabs.conductor.ControllerChangeHandler.fromBundle(ControllerChangeHandler.java:123)
at com.bluelinelabs.conductor.RouterTransaction.(RouterTransaction.java:42)
at com.bluelinelabs.conductor.Backstack.restoreInstanceState(Backstack.java:113)
at com.bluelinelabs.conductor.Router.restoreInstanceState(Router.java:648)
at com.bluelinelabs.conductor.ActivityHostedRouter.restoreInstanceState(ActivityHostedRouter.java:49)
at com.bluelinelabs.conductor.internal.LifecycleHandler.getRouter(LifecycleHandler.java:90)
at com.bluelinelabs.conductor.Conductor.attachRouter(Conductor.java:38)`
I think problem with `restoreFromBundle` method in `TransitionChangeHandlerCompat`
cause it try to instantiate null `changeHandler` cause controller store`TransitionChangeHandlerCompat` with empty bundle
Contributor guide
Research direction
Start in TransitionChangeHandlerCompat.java at restoreFromBundle, then follow ControllerChangeHandler.fromBundle and the RouterTransaction/Backstack restore path named in the stack trace. Reproduce the provided TransitionChangeHandlerCompat setup and verify that restoring state no longer throws a NullPointerException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 39/100