From a7d6b9a8058d7c9af7ba1ee9012658ce90987aa3 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Sat, 15 Jun 2019 13:22:36 +0200 Subject: [PATCH] Fix crash if icon can't be found --- .../Plugins/NotificationsPlugin/NotificationsPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java index 0482fbb3..92afbcca 100644 --- a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/NotificationsPlugin.java @@ -304,10 +304,10 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver. PackageManager pm = context.getPackageManager(); Resources foreignResources = pm.getResourcesForApplication(statusBarNotification.getPackageName()); - Drawable foreignIcon = foreignResources.getDrawable(notification.icon); + Drawable foreignIcon = foreignResources.getDrawable(notification.icon); //Might throw Resources.NotFoundException return drawableToBitmap(foreignIcon); - } catch (PackageManager.NameNotFoundException e) { + } catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) { Log.e(TAG, "Package not found", e); }