From 32e3203034f2446b4914a69d9368a4f6d05933b6 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Sun, 19 Aug 2018 15:50:48 +0200 Subject: [PATCH] Try to fix null context Signed-off-by: Mario Danic --- .../main/java/com/nextcloud/talk/utils/NotificationUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.java b/app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.java index cec35d5ac..24876057b 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/NotificationUtils.java @@ -76,7 +76,8 @@ public class NotificationUtils { } public static void cancelExistingNotifications(Context context, UserEntity conversationUser) { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && conversationUser.getId() != -1) { + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M && conversationUser.getId() != -1 && + context != null) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);