From 113739e1d9aed3b1567eff0fedbcc356c4fc168a Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Mon, 6 Jun 2016 00:01:48 +0200 Subject: [PATCH] Fixed rare crash --- .../Plugins/NotificationsPlugin/NotificationsPlugin.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java index c42a7c9b..f09175a3 100644 --- a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java @@ -433,6 +433,10 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver. service.cancelNotification(compatKey); } else { int first = compatKey.indexOf(':'); + if (first == -1) { + Log.e("cancelNotificationCompa","Not formated like a notification key: "+ compatKey); + return; + } int last = compatKey.lastIndexOf(':'); String packageName = compatKey.substring(0, first); String tag = compatKey.substring(first + 1, last);