Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81469702 authored by tiansiming's avatar tiansiming Committed by siming tian
Browse files

Fix NPE crash in AppInfoBase



This crash can hardly happen under the normal operation of the user,
but it may have a chance to appear in monkey test. To enhance the 
robustness of the program, intent.getData() here should not be null 
in any situations.

Bug: N/A
Test: adb shell am start -n
'com.android.settings/.Settings\$AppDrawOverlaySettingsActivity'

Change-Id: I732b564056e3e585405f146d99efe3b410edbc41
Signed-off-by: default avatartiansiming <tiansiming@xiaomi.com>
parent 43b1b97e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
        if (mPackageName == null) {
            Intent intent = (args == null) ?
                    getActivity().getIntent() : (Intent) args.getParcelable("intent");
            if (intent != null) {
            if (intent != null && intent.getData() != null) {
                mPackageName = intent.getData().getSchemeSpecificPart();
            }
        }