Merge "Possible NullPointerException in restorePanelState"

This commit is contained in:
Jean-Baptiste Queru
2012-05-01 05:51:59 -07:00
committed by android code review

View File

@@ -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