Fix NPE in autofill

Test: manual

bug:37330744

Change-Id: I110ece0b9283adb9998f8df795e2107da772482e
(cherry picked from commit 833c68e9fd47e8e8ad2e93683d3aba2d94ba73c1)
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 67c2314c..4b28337 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -569,7 +569,7 @@
                 }
                 viewState = new ViewState(this, id, value, this, ViewState.STATE_INITIAL);
                 mViewStates.put(id, viewState);
-            } else if ((flags & FLAG_VIEW_ENTERED) != 0) {
+            } else if (mStructure != null && (flags & FLAG_VIEW_ENTERED) != 0) {
                 viewState = startPartitionLocked(id, value);
             } else {
                 if (VERBOSE) Slog.v(TAG, "Ignored " + getFlagAsString(flags) + " for " + id);