Enable detekt rules UseLet and fix existing issues.
This commit is contained in:
parent
b8281052b9
commit
495d6020ad
3 changed files with 14 additions and 17 deletions
|
|
@ -100,15 +100,15 @@ class DefaultPushHandler @Inject constructor(
|
|||
}
|
||||
|
||||
val clientSecret = pushData.clientSecret
|
||||
val userId = if (clientSecret == null) {
|
||||
// Should not happen. In this case, restore default session
|
||||
null
|
||||
} else {
|
||||
// Get userId from client secret
|
||||
pushClientSecret.getUserIdFromSecret(clientSecret)
|
||||
} ?: run {
|
||||
matrixAuthenticationService.getLatestSessionId()
|
||||
}
|
||||
// clientSecret should not be null. If this happens, restore default session
|
||||
val userId = clientSecret
|
||||
?.let {
|
||||
// Get userId from client secret
|
||||
pushClientSecret.getUserIdFromSecret(clientSecret)
|
||||
}
|
||||
?: run {
|
||||
matrixAuthenticationService.getLatestSessionId()
|
||||
}
|
||||
|
||||
if (userId == null) {
|
||||
Timber.w("Unable to get a session")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue