Prevent NullPointerException when destination is null for some reason

This commit is contained in:
AsamK 2020-12-15 18:58:49 +01:00
parent 1098b64711
commit 49c4b762b6

View file

@ -1868,7 +1868,7 @@ public class Manager implements Closeable {
) {
List<HandleAction> actions = new ArrayList<>();
if (content != null) {
SignalServiceAddress sender;
final SignalServiceAddress sender;
if (!envelope.isUnidentifiedSender() && envelope.hasSource()) {
sender = envelope.getSourceAddress();
} else {
@ -1895,12 +1895,15 @@ public class Manager implements Closeable {
SignalServiceSyncMessage syncMessage = content.getSyncMessage().get();
if (syncMessage.getSent().isPresent()) {
SentTranscriptMessage message = syncMessage.getSent().get();
final SignalServiceAddress destination = message.getDestination().orNull();
if (destination != null) {
actions.addAll(handleSignalServiceDataMessage(message.getMessage(),
true,
sender,
message.getDestination().orNull(),
destination,
ignoreAttachments));
}
}
if (syncMessage.getRequest().isPresent()) {
RequestMessage rm = syncMessage.getRequest().get();
if (rm.isContactsRequest()) {