Skip to content

Commit 44d6d00

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

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
vNext
22
----------
33
- [MINOR] Use legacy FIDO2 API to provide security key support to Android 13 devices (#2508)
4+
- [MINOR] Handle error gracefully when amazon app url scheme is not found
45

56
Version 18.0.0
67
----------

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)