Catch PackageManager$NameNotFoundException

This commit is contained in:
MM20 2023-10-13 15:08:51 +02:00
parent fb41d3e2ab
commit 0b5ba802db
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -121,12 +121,16 @@ fun rememberSplashScreenData(searchable: SavableSearchable?): SplashScreenData {
}
} ?: return@withContext
val themeRes = activityInfo.themeResource
val ctx = context.createPackageContext(
searchable.`package`,
Context.CONTEXT_IGNORE_SECURITY
)
ctx.setTheme(themeRes)
val ctx = try {
context.createPackageContext(
searchable.`package`,
Context.CONTEXT_IGNORE_SECURITY
)
} catch (e: PackageManager.NameNotFoundException) {
return@withContext
}
ctx.setTheme(themeRes)
val theme = ctx.theme
val typedValue = TypedValue()