From 32b1e5b306fb52ffb413fa88de4ac1c61520514d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 11 Sep 2017 09:23:14 +0200 Subject: [PATCH] additional null checks around 'read by' intent --- .../conversations/services/XmppConnectionService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index c48c83296..1259707d5 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -644,7 +644,8 @@ public class XmppConnectionService extends Service { String pushedAccountHash = null; boolean interactive = false; if (action != null) { - final Conversation c = findConversationByUuid(intent.getStringExtra("uuid")); + final String uuid = intent.getStringExtra("uuid"); + final Conversation c = findConversationByUuid(uuid); switch (action) { case ConnectivityManager.CONNECTIVITY_ACTION: if (hasInternetConnection() && Config.RESET_ATTEMPT_COUNT_ON_NETWORK_CHANGE) { @@ -687,7 +688,11 @@ public class XmppConnectionService extends Service { } break; case ACTION_MARK_AS_READ: - sendReadMarker(c); + if (c != null) { + sendReadMarker(c); + } else { + Log.d(Config.LOGTAG,"received mark read intent for unknown conversation ("+uuid+")"); + } break; case AudioManager.RINGER_MODE_CHANGED_ACTION: if (dndOnSilentMode()) {