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

Commit 554bb019 authored by Dmitry Tsyganyuk's avatar Dmitry Tsyganyuk
Browse files

Possible NullPointerException in restorePanelState

curFeatureId is just an index in a cycle and can not be used for getting an object. May get null that will cause NullPointerException. Solution is to use key to get an object from icicles.

Change-Id: I61d5c6bd1c3226a993f60efa74872995ba0e42ac
parent 8ea93aa6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1653,7 +1653,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
     */
    private void restorePanelState(SparseArray<Parcelable> icicles) {
        PanelFeatureState st;
        for (int curFeatureId = icicles.size() - 1; curFeatureId >= 0; curFeatureId--) {
        int curFeatureId;
        for (int i = icicles.size() - 1; i >= 0; i--) {
            curFeatureId = icicles.keyAt(i);
            st = getPanelState(curFeatureId, false /* required */);
            if (st == null) {
                // The panel must not have been required, and is currently not around, skip it