Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ebd5f7c authored by Joanne Chung's avatar Joanne Chung
Browse files

Fix NPE if no AutofillId when traversing the view tree.

Bug: 415172066
Test: atest CtsTranslationTestCases
Change-Id: Ic4d7fac7348199d4752c622036d6b57c186816e5
parent 24b56011
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -623,7 +623,7 @@ public class UiTranslationController {

    private void addViewIfNeeded(IntArray sourceViewIds, View view) {
        final AutofillId autofillId = view.getAutofillId();
        if ((sourceViewIds.indexOf(autofillId.getViewId()) >= 0)
        if (autofillId != null && (sourceViewIds.indexOf(autofillId.getViewId()) >= 0)
                && !mViews.containsKey(autofillId)) {
            mViews.put(autofillId, new WeakReference<>(view));
        }