Open abyrnes opened 6 years ago
I suppose this could be related to #36
Thanks for reporting. Yes it might be related to #36 or to #26
I'm not sure how this can happen, because it seems that presenter is null
. Do you have a controller that doesn't have a UI (returning null from Controller.onCreateView()
)? Or maybe this happens if the user clicks back button fast enough before the View has been created because Presenter gets created after Controller.onCreateView()
.
Any idea how to reproduce this?
I've been able to resolve the issue on my side: We had a case where a child router was being used and the root was being set without checking if it already had a root after process death. Simply making sure that the root was only being set if necessary fixed the problem.
Not sure if any extra action should be taken here
If possible I can bump up this topic.
I have an interesting situation.
ViewPagerControllerA > PageA pushes ViewPagerControllerB > Page B
...
Activity is killed (Dunno how it happens, but I reproduced it by setting "kill activities" in developer options)
All controllers are being destroyed
....
Activity is restored
...
Attempt to invoke interface method 'void com.hannesdorfmann.mosby3.mvi.MviPresenter.destroy()' on a null object reference
Becase view hierarchy is restoring to ViewPagerControllerB, while trying to remove ViewPagerControllerA which doesn't exist anymore.
Am I correct in this assumption?
I guess presenter?.destroy()
would do?
I found the following crasher. No repro steps unfortunately. But hopefully someone has an idea as to why it's happening: