Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
LegacySavedStateHandleController
null pointer exception when th…
…e store is cleared during recreation * `viewModelStore.keys()` returns a copy of the current keys, but `ViewModelStore.clear()` can be called before the for-each loop finishes. That would result in a null pointer exception because the returned `viewModel` is null, but we force-cast it to a non-null value with the double-bang (!!) operator. * There is no risk in skipping null view models, as a store that has been cleared should not be attached to a `SavedStateHandle`, and any state would be cleared. Test: N/A Bug: 367431234 Change-Id: I6f16881b2f8dead781aa52a58c2652c8e40a35d9
- Loading branch information