Only generate prekeys if the corresponding identity key exists

This commit is contained in:
AsamK 2022-05-23 17:39:18 +02:00
parent 5b1c6c0d64
commit ce7aeb02bc

View file

@ -45,11 +45,11 @@ public class PreKeyHelper {
}
public void refreshPreKeys(ServiceIdType serviceIdType) throws IOException {
final var oneTimePreKeys = generatePreKeys(serviceIdType);
final var identityKeyPair = account.getIdentityKeyPair(serviceIdType);
if (identityKeyPair == null) {
return;
}
final var oneTimePreKeys = generatePreKeys(serviceIdType);
final var signedPreKeyRecord = generateSignedPreKey(serviceIdType, identityKeyPair);
dependencies.getAccountManager()