Enable detekt rule UseCheckOrError and fix existing issues (and a potential crash on MapboxMap?).
This commit is contained in:
parent
f3974dd570
commit
9e3679cbd6
4 changed files with 4 additions and 4 deletions
|
|
@ -92,7 +92,7 @@ class ConfirmAccountProviderPresenter @AssistedInject constructor(
|
||||||
} else if (matrixHomeServerDetails.supportsPasswordLogin) {
|
} else if (matrixHomeServerDetails.supportsPasswordLogin) {
|
||||||
LoginFlow.PasswordLogin
|
LoginFlow.PasswordLogin
|
||||||
} else {
|
} else {
|
||||||
throw IllegalStateException("Unsupported login flow")
|
error("Unsupported login flow")
|
||||||
}
|
}
|
||||||
}.getOrThrow()
|
}.getOrThrow()
|
||||||
}.runCatchingUpdatingState(loginFlowAction, errorTransform = ChangeServerError::from)
|
}.runCatchingUpdatingState(loginFlowAction, errorTransform = ChangeServerError::from)
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ private fun MapView.lifecycleObserver(previousState: MutableState<Lifecycle.Even
|
||||||
Lifecycle.Event.ON_DESTROY -> {
|
Lifecycle.Event.ON_DESTROY -> {
|
||||||
//handled in onDispose
|
//handled in onDispose
|
||||||
}
|
}
|
||||||
else -> throw IllegalStateException()
|
Lifecycle.Event.ON_ANY -> Unit
|
||||||
}
|
}
|
||||||
previousState.value = event
|
previousState.value = event
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ class RustMatrixAuthenticationService @Inject constructor(
|
||||||
client.restoreSession(sessionData.toSession())
|
client.restoreSession(sessionData.toSession())
|
||||||
createMatrixClient(client)
|
createMatrixClient(client)
|
||||||
} else {
|
} else {
|
||||||
throw IllegalStateException("No session to restore with id $sessionId")
|
error("No session to restore with id $sessionId")
|
||||||
}
|
}
|
||||||
}.mapFailure { failure ->
|
}.mapFailure { failure ->
|
||||||
failure.mapClientException()
|
failure.mapClientException()
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ style:
|
||||||
ProtectedMemberInFinalClass:
|
ProtectedMemberInFinalClass:
|
||||||
active: false
|
active: false
|
||||||
UseCheckOrError:
|
UseCheckOrError:
|
||||||
active: false
|
active: true
|
||||||
|
|
||||||
empty-blocks:
|
empty-blocks:
|
||||||
EmptyFunctionBlock:
|
EmptyFunctionBlock:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue