Fix rare null pointer exception when receiving message from untrusted identity

This commit is contained in:
AsamK 2021-08-22 18:47:20 +02:00
parent a7c9995655
commit 0a5e836ab6

View file

@ -1843,7 +1843,7 @@ public class Manager implements Closeable {
) throws IOException, InterruptedException {
retryFailedReceivedMessages(handler, ignoreAttachments);
Set<HandleAction> queuedActions = null;
Set<HandleAction> queuedActions = new HashSet<>();
final var signalWebSocket = dependencies.getSignalWebSocket();
signalWebSocket.connect();
@ -1872,7 +1872,6 @@ public class Manager implements Closeable {
// Received indicator that server queue is empty
hasCaughtUpWithOldMessages = true;
if (queuedActions != null) {
for (var action : queuedActions) {
try {
action.execute(this);
@ -1884,8 +1883,6 @@ public class Manager implements Closeable {
}
}
queuedActions.clear();
queuedActions = null;
}
// Continue to wait another timeout for new messages
continue;
@ -1939,9 +1936,6 @@ public class Manager implements Closeable {
}
}
} else {
if (queuedActions == null) {
queuedActions = new HashSet<>();
}
queuedActions.addAll(actions);
}
}