Bug Fix: fix NullPointerException while scrolling message apps am: 018e3d97d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15605141 Change-Id: I7dc955f1c4444ddf361ae827ce10db2e476a3e25
This commit is contained in:
@@ -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.");
|
||||||
|
|||||||
Reference in New Issue
Block a user