Fix NPE in libsignal-net sendKeepAlive.

This commit is contained in:
andrew-signal
2025-02-19 10:05:51 -05:00
committed by Greyson Parrelli
parent 4474d1fc9e
commit 20cecbd5cd

View File

@@ -289,7 +289,11 @@ class LibSignalChatConnection(
override fun sendKeepAlive() {
CHAT_SERVICE_LOCK.withLock {
if (isDead()) {
// This is a stronger check than isDead, to handle the case where chatConnection may be null
// because we are still connecting.
// TODO [andrew]: Decide if this is the right behavior long term, or if we want to queue these
// like we plan to queue other requests long term.
if (state.value != WebSocketConnectionState.CONNECTED) {
return
}