Fix for potential crash displaying <select> dialog
Reland fix for b/11653861 which was accidentally lost in an
upstream refactoring.
Bug: 13635997
Change-Id: Ib3a74396a4c301c0db8da268cce05a0d846ca250
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupAdapter.java
index 1118e78..ca8e5f0 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupAdapter.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/SelectPopupAdapter.java
@@ -60,7 +60,11 @@
if (mItems.get(position).getType() == PopupItemType.GROUP) {
// Currently select_dialog_multichoice uses CheckedTextViews.
// If that changes, the class cast will no longer be valid.
- ((CheckedTextView) convertView).setCheckMarkDrawable(null);
+ // The WebView build cannot rely on this being the case, so
+ // we must check.
+ if (convertView instanceof CheckedTextView) {
+ ((CheckedTextView) convertView).setCheckMarkDrawable(null);
+ }
} else {
// Draw the disabled element in a disabled state.
convertView.setEnabled(false);