Catch all exceptions when reading session record

Fixes #1083
This commit is contained in:
AsamK 2022-11-03 15:55:12 +01:00
parent 6502f3f487
commit 6281cbfd5f

View file

@ -3,7 +3,6 @@ package org.asamk.signal.manager.storage.sessions;
import org.asamk.signal.manager.api.Pair; import org.asamk.signal.manager.api.Pair;
import org.asamk.signal.manager.storage.Database; import org.asamk.signal.manager.storage.Database;
import org.asamk.signal.manager.storage.Utils; import org.asamk.signal.manager.storage.Utils;
import org.signal.libsignal.protocol.InvalidMessageException;
import org.signal.libsignal.protocol.NoSessionException; import org.signal.libsignal.protocol.NoSessionException;
import org.signal.libsignal.protocol.SignalProtocolAddress; import org.signal.libsignal.protocol.SignalProtocolAddress;
import org.signal.libsignal.protocol.ecc.ECPublicKey; import org.signal.libsignal.protocol.ecc.ECPublicKey;
@ -339,7 +338,7 @@ public class SessionStore implements SignalServiceSessionStore {
try { try {
final var record = resultSet.getBytes("record"); final var record = resultSet.getBytes("record");
return new SessionRecord(record); return new SessionRecord(record);
} catch (InvalidMessageException e) { } catch (Exception e) {
logger.warn("Failed to load session, resetting session: {}", e.getMessage()); logger.warn("Failed to load session, resetting session: {}", e.getMessage());
return null; return null;
} }