Add a null check to avoid NPE.

Because getTextCursorDrawable() can return null, this CL adds a null
check so that it won't cause a NPE on ARC++.

Bug: 244632907
Test: Manual
Change-Id: I96a7817b2697eedff9f35762124a97d9e04992a8
This commit is contained in:
Merissa Tan
2022-09-29 11:16:25 -07:00
committed by Merissa Mitchell
parent ff008f0747
commit 59b90a43bd

View File

@@ -221,8 +221,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
mEditText.setTextColor(textColor);
mEditText.setHintTextColor(hintColor);
mEditText.getTextCursorDrawable().setColorFilter(
accentColor.getDefaultColor(), PorterDuff.Mode.SRC_IN);
if (mEditText.getTextCursorDrawable() != null) {
mEditText.getTextCursorDrawable().setColorFilter(
accentColor.getDefaultColor(), PorterDuff.Mode.SRC_IN);
}
mContentBackground.setColor(editBgColor);
mContentBackground.setStroke(stroke, accentColor);
mDelete.setImageTintList(ColorStateList.valueOf(deleteFgColor));