From 354587a972b001d809033698bf34597d153c53a2 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Tue, 16 May 2017 10:37:33 -0700 Subject: [PATCH] Check for mAttachInfo nullness when getting the autofillable drawable. Test: manual verification on Caviar (automated test will be added later) Test: CtsAutoFillServiceTestCases pass Bug: 38341498 Fixes: 38323841 Change-Id: I15cc792de87987cc19a229c2ab2dfc317877f7ec --- core/java/android/view/View.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index d3d753b3ee8fb..2d48295673b87 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -20506,6 +20506,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @throws IllegalStateException if the drawable could not be found. */ @Nullable private Drawable getAutofilledDrawable() { + if (mAttachInfo == null) { + return null; + } // Lazily load the isAutofilled drawable. if (mAttachInfo.mAutofilledDrawable == null) { Context rootContext = getRootView().getContext();