Don't crash if the saved state is invalid.
Bug: 3429970
Change-Id: I0b2e82d0259b34dad9701cdef9645670863e0d70
diff --git a/src/com/android/apps/tag/EditTagActivity.java b/src/com/android/apps/tag/EditTagActivity.java
index e04421c..4755ea8 100644
--- a/src/com/android/apps/tag/EditTagActivity.java
+++ b/src/com/android/apps/tag/EditTagActivity.java
@@ -105,7 +105,12 @@
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();
}