Don't crash if the saved state is invalid.
Jeff Hamilton [Mon, 4 Apr 2011 02:12:13 +0000 (21:12 -0500)]
Bug: 3429970
Change-Id: I0b2e82d0259b34dad9701cdef9645670863e0d70

src/com/android/apps/tag/EditTagActivity.java

index e04421c..4755ea8 100644 (file)
@@ -105,7 +105,12 @@ public class EditTagActivity extends Activity implements OnClickListener, EditCa
 
         if (savedState != null) {
             mRecord = savedState.getParcelable(BUNDLE_KEY_RECORD);
-            refresh();
+            if (mRecord != null) {
+                refresh();
+            } else {
+                Log.w(LOG_TAG, "invalid instance state, loading from intent");
+                resolveIntent();
+            }
         } else {
             resolveIntent();
         }