From fe7499723521df1762f963be6057ab5b4f0db080 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 15 Mar 2022 10:02:39 -0700 Subject: [PATCH] Fix NPE in BubbleTextView - Icon can be null when we use BTV for text only Bug: 223809081 Test: manual Change-Id: I9efd8e4b420127beb249b20e71ae37c359bb6467 --- src/com/android/launcher3/BubbleTextView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 041bee95a2..3bc0f6df7a 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -867,6 +867,11 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, } protected void applyCompoundDrawables(Drawable icon) { + if (icon == null) { + // Icon can be null when we use the BubbleTextView for text only. + return; + } + // If we had already set an icon before, disable relayout as the icon size is the // same as before. mDisableRelayout = mIcon != null;