Add null check before finish SystemUI Tuner's activity

SystemUI Tuner's activity changes to null when Multi-window's state is
changed after confirmation dialog about removing SystemUI Tuner is
shown. Then NullPointerException occurs by trying to finish the
activity to tap "REMOVE" button on the confirmation dialog.
So add null check before finish the activity.

Bug: 32786029
Test: manual - remove System UI Tuner on Multi-Window mode

Change-Id: I455d17c0c600eeb05c9dfb7d609d40307de2f855
This commit is contained in:
Akira Oshimi
2016-09-29 12:17:24 +09:00
committed by Yoshinori Hirano
parent 836e74052e
commit 8fbcb7630a

View File

@@ -104,7 +104,9 @@ public class TunerFragment extends PreferenceFragment {
TunerService.showResetRequest(getContext(), new Runnable() {
@Override
public void run() {
getActivity().finish();
if (getActivity() != null) {
getActivity().finish();
}
}
});
return true;