mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 05:37:43 +00:00
Fix crash if icon can't be found
This commit is contained in:
parent
f688aad3e1
commit
a7d6b9a805
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user