Add a check to ensure that intent data is available before proceeding.
Summary: There are instances where intent data is absent, leading to a crash while trying to retrieve the schema. This change adds a null check to prevent attempted access when there's no data.
Test: Successful Build on master branch
Change-Id: Ie83bd3243f2c79102061d3fa43d809b3ef3c6c78
Signed-off-by: Abdelrahman Daim <adaim@meta.com>
diff --git a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
index 90d733e..1712e85 100644
--- a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
+++ b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
@@ -715,7 +715,7 @@
if (mPackageName == null) {
final Intent intent = args == null ?
getActivity().getIntent() : (Intent) args.getParcelable("intent");
- if (intent != null) {
+ if (intent != null && intent.getData() != null) {
mPackageName = intent.getData().getSchemeSpecificPart();
}
}