Fix unlikely issues with null values

This commit is contained in:
AsamK 2021-10-24 20:46:33 +02:00
parent fc5af35a04
commit 9cb1409918
2 changed files with 3 additions and 3 deletions

View file

@ -95,7 +95,7 @@ public class SenderKeyRecordStore implements org.whispersystems.libsignal.groups
return; return;
} }
logger.debug("Only to be merged recipient had sender keys, re-assigning to the new recipient."); logger.debug("To be merged recipient had sender keys, re-assigning to the new recipient.");
for (var key : keys) { for (var key : keys) {
final var toBeMergedSenderKey = loadSenderKeyLocked(key); final var toBeMergedSenderKey = loadSenderKeyLocked(key);
deleteSenderKeyLocked(key); deleteSenderKeyLocked(key);
@ -108,7 +108,7 @@ public class SenderKeyRecordStore implements org.whispersystems.libsignal.groups
if (senderKeyRecord != null) { if (senderKeyRecord != null) {
continue; continue;
} }
storeSenderKeyLocked(newKey, senderKeyRecord); storeSenderKeyLocked(newKey, toBeMergedSenderKey);
} }
} }
} }

View file

@ -59,7 +59,7 @@ public class MessageCacheUtils {
if (version >= 4) { if (version >= 4) {
serverDeliveredTimestamp = in.readLong(); serverDeliveredTimestamp = in.readLong();
} }
Optional<SignalServiceAddress> addressOptional = sourceUuid == null && source.isEmpty() Optional<SignalServiceAddress> addressOptional = sourceUuid == null
? Optional.absent() ? Optional.absent()
: Optional.of(new SignalServiceAddress(sourceUuid, source)); : Optional.of(new SignalServiceAddress(sourceUuid, source));
return new SignalServiceEnvelope(type, return new SignalServiceEnvelope(type,