From a8bc4f24c71993a9a4af69e1e32f2f56e5587c0b Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Thu, 21 Mar 2019 23:02:04 +0100 Subject: [PATCH] Fix crash on old API --- .../Plugins/NotificationsPlugin/NotificationsPlugin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java index 33a46528..29f22d2c 100644 --- a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java @@ -466,8 +466,10 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver. private void sendCurrentNotifications(NotificationReceiver service) { StatusBarNotification[] notifications = service.getActiveNotifications(); - for (StatusBarNotification notification : notifications) { - sendNotification(notification); + if (notifications != null) { //Can happen only on API 23 and lower + for (StatusBarNotification notification : notifications) { + sendNotification(notification); + } } }