Merge "Fixed NPE when AutofillManager.getClient() returns null." into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-10 13:54:19 +00:00
committed by Android (Google) Code Review

View File

@@ -3248,7 +3248,12 @@ public final class AutofillManager {
final AutofillManager afm = mAfm.get();
if (afm == null) return null;
final View view = afm.getClient().autofillClientFindViewByAutofillIdTraversal(id);
final AutofillClient client = afm.getClient();
if (client == null) {
Log.w(TAG, "getViewCoordinates(" + id + "): no autofill client");
return null;
}
final View view = client.autofillClientFindViewByAutofillIdTraversal(id);
if (view == null) {
Log.w(TAG, "getViewCoordinates(" + id + "): could not find view");
return null;