mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Fix rare null pointer exception when receiving message from untrusted identity
This commit is contained in:
parent
a7c9995655
commit
0a5e836ab6
1 changed files with 9 additions and 15 deletions
|
@ -1843,7 +1843,7 @@ public class Manager implements Closeable {
|
||||||
) throws IOException, InterruptedException {
|
) throws IOException, InterruptedException {
|
||||||
retryFailedReceivedMessages(handler, ignoreAttachments);
|
retryFailedReceivedMessages(handler, ignoreAttachments);
|
||||||
|
|
||||||
Set<HandleAction> queuedActions = null;
|
Set<HandleAction> queuedActions = new HashSet<>();
|
||||||
|
|
||||||
final var signalWebSocket = dependencies.getSignalWebSocket();
|
final var signalWebSocket = dependencies.getSignalWebSocket();
|
||||||
signalWebSocket.connect();
|
signalWebSocket.connect();
|
||||||
|
@ -1872,20 +1872,17 @@ public class Manager implements Closeable {
|
||||||
// Received indicator that server queue is empty
|
// Received indicator that server queue is empty
|
||||||
hasCaughtUpWithOldMessages = true;
|
hasCaughtUpWithOldMessages = true;
|
||||||
|
|
||||||
if (queuedActions != null) {
|
for (var action : queuedActions) {
|
||||||
for (var action : queuedActions) {
|
try {
|
||||||
try {
|
action.execute(this);
|
||||||
action.execute(this);
|
} catch (Throwable e) {
|
||||||
} catch (Throwable e) {
|
if (e instanceof AssertionError && e.getCause() instanceof InterruptedException) {
|
||||||
if (e instanceof AssertionError && e.getCause() instanceof InterruptedException) {
|
Thread.currentThread().interrupt();
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
logger.warn("Message action failed.", e);
|
|
||||||
}
|
}
|
||||||
|
logger.warn("Message action failed.", e);
|
||||||
}
|
}
|
||||||
queuedActions.clear();
|
|
||||||
queuedActions = null;
|
|
||||||
}
|
}
|
||||||
|
queuedActions.clear();
|
||||||
|
|
||||||
// Continue to wait another timeout for new messages
|
// Continue to wait another timeout for new messages
|
||||||
continue;
|
continue;
|
||||||
|
@ -1939,9 +1936,6 @@ public class Manager implements Closeable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (queuedActions == null) {
|
|
||||||
queuedActions = new HashSet<>();
|
|
||||||
}
|
|
||||||
queuedActions.addAll(actions);
|
queuedActions.addAll(actions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue