2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 13:47:41 +00:00

Fix crash if icon can't be found

This commit is contained in:
Albert Vaca
2019-06-15 13:22:36 +02:00
parent f688aad3e1
commit a7d6b9a805

View File

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