Catch errors when intent URI is not valid (#3799)

This commit is contained in:
Daniel Shokouhi 2023-08-19 11:37:34 -07:00 committed by GitHub
parent 8d3c2609fe
commit 477c299272
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1489,7 +1489,12 @@ class MessagingManager @Inject constructor(
context.packageManager.getLaunchIntentForPackage(uri.substringAfter(APP_PREFIX))
}
uri.startsWith(INTENT_PREFIX) -> {
Intent.parseUri(uri, Intent.URI_INTENT_SCHEME)
try {
Intent.parseUri(uri, Intent.URI_INTENT_SCHEME)
} catch (e: Exception) {
Log.e(TAG, "Unable to parse intent URI", e)
null
}
}
uri.startsWith(SETTINGS_PREFIX) -> {
if (uri.substringAfter(SETTINGS_PREFIX) == NOTIFICATION_HISTORY) {