From 532431b0ad36436ec133263303f796effd865d32 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Wed, 31 Oct 2018 08:19:33 -0700 Subject: [PATCH] Guard against notifying for errors on non-existent SMS threads. All of the other send jobs do this already, just didn't do it here. --- src/org/thoughtcrime/securesms/jobs/SmsSendJob.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java b/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java index 0452924ec5..9600646b39 100644 --- a/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java @@ -89,7 +89,10 @@ public class SmsSendJob extends SendJob { Recipient recipient = DatabaseFactory.getThreadDatabase(context).getRecipientForThreadId(threadId); DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId); - MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId); + + if (threadId != -1 && recipient != null) { + MessageNotifier.notifyMessageDeliveryFailed(context, recipient, threadId); + } } private void deliver(SmsMessageRecord message)