Reset null dialog icons

Presently, we call .mutate() on a potentially null icon. In
these cases, we should instead clear the icon.

Bug: 966909
Change-Id: I6181c72d29ef15dfd543affcd7b8b38a664eef95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1676724
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Commit-Queue: Ian Vollick <vollick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672142}
diff --git a/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/dialog/TouchlessDialogPresenter.java b/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/dialog/TouchlessDialogPresenter.java
index 8da79bd..5ed0af8 100644
--- a/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/dialog/TouchlessDialogPresenter.java
+++ b/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/dialog/TouchlessDialogPresenter.java
@@ -180,10 +180,14 @@
         ChromeImageView imageView = view.findViewById(R.id.dialog_item_icon);
         TextView textView = view.findViewById(R.id.dialog_item_text);
         if (DialogListItemProperties.ICON == propertyKey) {
-            imageView.setVisibility(View.VISIBLE);
-            Drawable icon = model.get(DialogListItemProperties.ICON).mutate();
-            icon.clearColorFilter();
-            imageView.setImageDrawable(icon);
+            if (model.get(DialogListItemProperties.ICON) == null) {
+                imageView.setImageDrawable(null);
+            } else {
+                imageView.setVisibility(View.VISIBLE);
+                Drawable icon = model.get(DialogListItemProperties.ICON).mutate();
+                icon.clearColorFilter();
+                imageView.setImageDrawable(icon);
+            }
         } else if (DialogListItemProperties.TEXT == propertyKey) {
             textView.setText(model.get(DialogListItemProperties.TEXT));
         } else if (DialogListItemProperties.CLICK_LISTENER == propertyKey) {