Fix NPE in onDestroy() when launched without args

The previous fix corrects startup, but crashes in
onDestroy because of null value assumed to be
initialized.

Bug: 201719995
Test: adb shell am start com.android.systemui/.usb.UsbResolverActivity
Change-Id: Ie255ece9e73db71cbb4468c59db6de79d8f659b5
This commit is contained in:
Mark Renouf
2021-10-05 15:18:27 -04:00
parent b727834722
commit da5eebde68

View File

@@ -901,7 +901,8 @@ public class ResolverActivity extends Activity implements
if (!isChangingConfigurations() && mPickOptionRequest != null) {
mPickOptionRequest.cancel();
}
if (mMultiProfilePagerAdapter.getActiveListAdapter() != null) {
if (mMultiProfilePagerAdapter != null
&& mMultiProfilePagerAdapter.getActiveListAdapter() != null) {
mMultiProfilePagerAdapter.getActiveListAdapter().onDestroy();
}
}