Skip to content

Commit

Permalink
Catch errors when intent URI is not valid (#3799)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshokouhi committed Aug 19, 2023
1 parent 8d3c260 commit 477c299
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 477c299

Please sign in to comment.