Reroute ISE to NoSessionException.

This commit is contained in:
Greyson Parrelli
2026-05-04 14:24:06 -04:00
parent 958c6f451f
commit adb9e2173f
2 changed files with 7 additions and 3 deletions
@@ -153,7 +153,7 @@ public interface EnvelopeContent {
}
@Override
public OutgoingPushMessage processUnsealedSender(SignalSessionCipher sessionCipher, SignalProtocolAddress destination) {
public OutgoingPushMessage processUnsealedSender(SignalSessionCipher sessionCipher, SignalProtocolAddress destination) throws NoSessionException {
String body = Base64.encodeWithPadding(plaintextContent.serialize());
int remoteRegistrationId = sessionCipher.getRemoteRegistrationId();
@@ -45,9 +45,13 @@ public class SignalSessionCipher {
}
}
public int getRemoteRegistrationId() {
public int getRemoteRegistrationId() throws NoSessionException {
try (SignalSessionLock.Lock unused = lock.acquire()) {
return cipher.getRemoteRegistrationId();
try {
return cipher.getRemoteRegistrationId();
} catch (IllegalStateException e) {
throw new NoSessionException(e.getMessage());
}
}
}