OSDN Git Service

Fix NPE in autofill
authorSvet Ganov <svetoslavganov@google.com>
Fri, 14 Apr 2017 17:11:46 +0000 (10:11 -0700)
committerSvetoslav Ganov <svetoslavganov@google.com>
Fri, 14 Apr 2017 17:29:51 +0000 (17:29 +0000)
Test: manual

bug:37330744

Change-Id: I110ece0b9283adb9998f8df795e2107da772482e

services/autofill/java/com/android/server/autofill/Session.java

index 67b5282..0b1381e 100644 (file)
@@ -586,7 +586,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                 }
                 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);