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

Commit 202ae028 authored by Joanne Chung's avatar Joanne Chung Committed by Automerger Merge Worker
Browse files

Bug Fix: fix NullPointerException while scrolling message apps am: 018e3d97 am: dd622014

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15605141

Change-Id: I0e1de4f04140c3dde12f13604e05cd21e9598492
parents fd73c15e dd622014
Loading
Loading
Loading
Loading
+10 −2
Original line number Original line Diff line number Diff line
@@ -356,7 +356,11 @@ public class UiTranslationController {
            }
            }
            for (int i = 0; i < translatedResult.size(); i++) {
            for (int i = 0; i < translatedResult.size(); i++) {
                final AutofillId autofillId = new AutofillId(translatedResult.keyAt(i));
                final AutofillId autofillId = new AutofillId(translatedResult.keyAt(i));
                final View view = mViews.get(autofillId).get();
                final WeakReference<View> viewRef = mViews.get(autofillId);
                if (viewRef == null) {
                    continue;
                }
                final View view = viewRef.get();
                if (view == null) {
                if (view == null) {
                    Log.w(TAG, "onTranslationCompleted: the view for autofill id " + autofillId
                    Log.w(TAG, "onTranslationCompleted: the view for autofill id " + autofillId
                            + " may be gone.");
                            + " may be gone.");
@@ -416,7 +420,11 @@ public class UiTranslationController {
                    Log.w(TAG, "No AutofillId is set in ViewTranslationResponse");
                    Log.w(TAG, "No AutofillId is set in ViewTranslationResponse");
                    continue;
                    continue;
                }
                }
                final View view = mViews.get(autofillId).get();
                final WeakReference<View> viewRef = mViews.get(autofillId);
                if (viewRef == null) {
                    continue;
                }
                final View view = viewRef.get();
                if (view == null) {
                if (view == null) {
                    Log.w(TAG, "onTranslationCompleted: the view for autofill id " + autofillId
                    Log.w(TAG, "onTranslationCompleted: the view for autofill id " + autofillId
                            + " may be gone.");
                            + " may be gone.");