From 268bf2cdfe15aa22637603fa9920b2a2769cbcd3 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Wed, 14 May 2014 18:55:14 +0900
Subject: [PATCH] Fix NPE that happens only in some unit tests

Bug: 14922410
Change-Id: Ica801e102d302e9faa7c24721b37634f1e812af3
---
 .../com/android/inputmethod/keyboard/EmojiPalettesView.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
index a02ff1175e..55e8071c15 100644
--- a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
+++ b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
@@ -153,7 +153,9 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
             textView.setText(mEmojiCategory.getCategoryLabel(categoryId));
             textView.setTypeface(Typeface.DEFAULT_BOLD);
             textView.setContentDescription(mEmojiCategory.getAccessibilityDescription(categoryId));
-            textView.setTextColor(mTabLabelColor);
+            if (mTabLabelColor != null) {
+                textView.setTextColor(mTabLabelColor);
+            }
             tspec.setIndicator(textView);
         }
         host.addTab(tspec);
-- 
GitLab