diff options
author | Romain Guy <romainguy@android.com> | 2009-10-15 15:09:26 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2009-10-15 15:09:26 -0700 |
commit | a8a720d8cd208d7d265de28ab69f7e68eb10140a (patch) | |
tree | d6d1f405499ae7cb36fc642b1437314f42af10cc /core/java/android/appwidget | |
parent | 30a6657ec6051ba5a1c72a714c9dc535dff127a4 (diff) | |
download | frameworks_base-a8a720d8cd208d7d265de28ab69f7e68eb10140a.zip frameworks_base-a8a720d8cd208d7d265de28ab69f7e68eb10140a.tar.gz frameworks_base-a8a720d8cd208d7d265de28ab69f7e68eb10140a.tar.bz2 |
Fix possible NPE in the code that restores widgets' state.
Bug #2189714
Reviewed by: ryanpc
Change-Id: I0d74deb6dc8e90e3b0eafd6b3c16b0c557c72873
Diffstat (limited to 'core/java/android/appwidget')
-rw-r--r-- | core/java/android/appwidget/AppWidgetHostView.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java index a4c141e..bb0cbe9 100644 --- a/core/java/android/appwidget/AppWidgetHostView.java +++ b/core/java/android/appwidget/AppWidgetHostView.java @@ -123,7 +123,8 @@ public class AppWidgetHostView extends FrameLayout { @Override protected void dispatchRestoreInstanceState(SparseArray<Parcelable> container) { - final ParcelableSparseArray jail = (ParcelableSparseArray) container.get(generateId()); + ParcelableSparseArray jail = (ParcelableSparseArray) container.get(generateId()); + if (jail == null) jail = new ParcelableSparseArray(); super.dispatchRestoreInstanceState(jail); } |