mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Add missing handling for SecureValueRecovery.RestoreResponse.Missing response
This commit is contained in:
parent
68dbf27b2f
commit
376a1704df
1 changed files with 8 additions and 2 deletions
|
@ -108,7 +108,10 @@ public class PinHelper {
|
||||||
) throws IOException, IncorrectPinException {
|
) throws IOException, IncorrectPinException {
|
||||||
var svr1Credentials = e.getSvr1Credentials();
|
var svr1Credentials = e.getSvr1Credentials();
|
||||||
if (svr1Credentials != null) {
|
if (svr1Credentials != null) {
|
||||||
return getRegistrationLockData(secureValueRecoveryV1, svr1Credentials, pin);
|
final var registrationLockData = getRegistrationLockData(secureValueRecoveryV1, svr1Credentials, pin);
|
||||||
|
if (registrationLockData != null) {
|
||||||
|
return registrationLockData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var svr2Credentials = e.getSvr2Credentials();
|
var svr2Credentials = e.getSvr2Credentials();
|
||||||
|
@ -132,8 +135,11 @@ public class PinHelper {
|
||||||
throw new IOException(error.getException());
|
throw new IOException(error.getException());
|
||||||
} else if (restoreResponse instanceof SecureValueRecovery.RestoreResponse.NetworkError error) {
|
} else if (restoreResponse instanceof SecureValueRecovery.RestoreResponse.NetworkError error) {
|
||||||
throw error.getException();
|
throw error.getException();
|
||||||
|
} else if (restoreResponse instanceof SecureValueRecovery.RestoreResponse.Missing) {
|
||||||
|
logger.debug("No SVR data stored for the given credentials.");
|
||||||
|
return null;
|
||||||
} else {
|
} else {
|
||||||
throw new AssertionError("Unexpected response");
|
throw new AssertionError("Unexpected response: " + restoreResponse.getClass().getSimpleName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue