Fix crash after entering incorrect pin for registration lock.
This commit is contained in:
parent
f3922c4156
commit
6ee04f6574
1 changed files with 5 additions and 3 deletions
|
@ -179,7 +179,8 @@ public final class RegistrationViewModel extends BaseRegistrationViewModel {
|
|||
} else {
|
||||
return Single.just(verifyAccountWithoutKbsResponse);
|
||||
}
|
||||
});
|
||||
})
|
||||
.onErrorReturn(ServiceResponse::forUnknownError);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -196,13 +197,14 @@ public final class RegistrationViewModel extends BaseRegistrationViewModel {
|
|||
setCanCallAtTime(processor.getNextCodeViaCallAttempt());
|
||||
}
|
||||
})
|
||||
.flatMap(processor -> {
|
||||
.<ServiceResponse<VerifyResponse>>flatMap(processor -> {
|
||||
if (processor.isAlreadyVerified() || (processor.hasResult() && processor.isVerified())) {
|
||||
return verifyAccountRepository.registerAccount(sessionId, getRegistrationData(), pin, () -> Objects.requireNonNull(KbsRepository.restoreMasterKey(pin, kbsTokenData.getEnclave(), kbsTokenData.getBasicAuth(), kbsTokenData.getTokenResponse())));
|
||||
} else {
|
||||
return Single.just(ServiceResponse.coerceError(processor.getResponse()));
|
||||
}
|
||||
});
|
||||
})
|
||||
.onErrorReturn(ServiceResponse::forUnknownError);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue