Try to fix null context

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-08-19 15:50:48 +02:00
parent d4ef4d0e4a
commit 32e3203034

View file

@ -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);