Skip to content

Commit dc9262a

Browse files
committed
Handle error gracefully when amazon app url scheme is not found
1 parent f57fb81 commit dc9262a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

common/src/main/java/com/microsoft/identity/common/internal/ui/webview/AzureActiveDirectoryWebViewClient.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,13 @@ private void launchCompanyPortal() {
405405
private void processAmazonAppUri(@NonNull final String url) {
406406
final String methodTag = TAG + ":processAmazonAppUri";
407407

408-
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
409-
getActivity().startActivity(intent);
410-
Logger.info(methodTag, "Sent Intent to launch Amazon app");
408+
try {
409+
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
410+
getActivity().startActivity(intent);
411+
Logger.info(methodTag, "Sent Intent to launch Amazon app");
412+
} catch (android.content.ActivityNotFoundException e) {
413+
Logger.error(methodTag, "Failed to launch Amazon app.", e);
414+
}
411415
}
412416

413417
private void openLinkInBrowser(final String url) {

0 commit comments

Comments
 (0)