We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93e4b7e commit 2a19bf4Copy full SHA for 2a19bf4
WordPress/src/main/java/org/wordpress/android/ui/sitecreation/SiteCreationMainVM.kt
@@ -169,7 +169,12 @@ class SiteCreationMainVM @Inject constructor(
169
} else {
170
siteCreationState = requireNotNull(savedInstanceState.getParcelableCompat(KEY_SITE_CREATION_STATE))
171
val currentStepIndex = savedInstanceState.getInt(KEY_CURRENT_STEP)
172
- wizardManager.setCurrentStepIndex(currentStepIndex)
+ try {
173
+ wizardManager.setCurrentStepIndex(currentStepIndex)
174
+ } catch (e: IllegalStateException) {
175
+ // If the current step index is invalid, we reset the wizard
176
+ wizardManager.setCurrentStepIndex(0)
177
+ }
178
}
179
isStarted = true
180
0 commit comments