Skip to content

Commit

Permalink
Merge pull request #20143 from wordpress-mobile/issue/20142-reader-cr…
Browse files Browse the repository at this point in the history
…ash-onsavedinstancestate

[Reader] Fix UninitializedPropertyAccessException in ReaderFragment
  • Loading branch information
RenanLukas authored Feb 7, 2024
2 parents 24b46d0 + 6b94752 commit 06ab0d7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ class ReaderFragment : Fragment(R.layout.reader_fragment_layout), ScrollableView

override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
viewModel.onSaveInstanceState(outState)
if (::viewModel.isInitialized) {
viewModel.onSaveInstanceState(outState)
}
}

private fun updateUiState(uiState: ReaderViewModel.ReaderUiState) {
Expand Down

0 comments on commit 06ab0d7

Please sign in to comment.