From fd3a1b2db655737297eccd82a77affb8112e7d62 Mon Sep 17 00:00:00 2001 From: jacquarg Date: Thu, 20 Jun 2024 20:47:23 +0200 Subject: [PATCH] fix:20240619: Sentry crash PackageManager --- .../permissions/PermissionsPrivacyModuleBase.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/foundation/e/advancedprivacy/externalinterfaces/permissions/PermissionsPrivacyModuleBase.kt b/core/src/main/java/foundation/e/advancedprivacy/externalinterfaces/permissions/PermissionsPrivacyModuleBase.kt index 69f5a7a6..d52a4671 100644 --- a/core/src/main/java/foundation/e/advancedprivacy/externalinterfaces/permissions/PermissionsPrivacyModuleBase.kt +++ b/core/src/main/java/foundation/e/advancedprivacy/externalinterfaces/permissions/PermissionsPrivacyModuleBase.kt @@ -144,10 +144,10 @@ abstract class PermissionsPrivacyModuleBase(protected val context: Context) : IP } fun getApplicationIcon(appInfo: ApplicationInfo): Drawable? { - return context.packageManager.getApplicationIcon(appInfo) + return runCatching { context.packageManager.getApplicationIcon(appInfo) }.getOrNull() } override fun getApplicationIcon(packageName: String): Drawable? { - return context.packageManager.getApplicationIcon(packageName) + return runCatching { context.packageManager.getApplicationIcon(packageName) }.getOrNull() } } -- GitLab