summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts
diff options
context:
space:
mode:
authorMarcos Marado <mmarado@cyngn.com>2015-07-24 17:19:06 +0100
committerRohit Yengisetty <rohit@cyngn.com>2015-11-17 22:33:08 -0800
commitd00fa35330e89c3497fff5cc319f2b2618974b62 (patch)
treeb468b95db2ea4ed52cc77f7b887f97af1dcd5b8b /src/com/android/contacts
parentc893e4906ea656c33d300a2726d0a5076c9275b2 (diff)
downloadandroid_packages_apps_ContactsCommon-d00fa35330e89c3497fff5cc319f2b2618974b62.tar.gz
android_packages_apps_ContactsCommon-d00fa35330e89c3497fff5cc319f2b2618974b62.tar.bz2
android_packages_apps_ContactsCommon-d00fa35330e89c3497fff5cc319f2b2618974b62.zip
string validation: check if the string is empty
By replacing a null check with an isEmpty check, we guarantee that the string not only isn't null, but also that it isn't empty. Previously, an empty string could reach here, pass through the validation, and then provoke a StringIndexOutOfBoundsException as we try to access charAt(0). Change-Id: Ibb1dad62d33584956fbb024ced03448df8598b39 Ticket: BUGDUMP-2892952
Diffstat (limited to 'src/com/android/contacts')
-rw-r--r--src/com/android/contacts/common/lettertiles/LetterTileDrawable.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/contacts/common/lettertiles/LetterTileDrawable.java b/src/com/android/contacts/common/lettertiles/LetterTileDrawable.java
index 14548deb..a7076032 100644
--- a/src/com/android/contacts/common/lettertiles/LetterTileDrawable.java
+++ b/src/com/android/contacts/common/lettertiles/LetterTileDrawable.java
@@ -164,7 +164,7 @@ public class LetterTileDrawable extends Drawable {
}
// Draw letter/digit only if the first character is an english letter
- if (mDisplayName != null
+ if (!TextUtils.isEmpty(mDisplayName)
&& isEnglishLetter(mDisplayName.charAt(0))
&& (mAccount == null || (mAccount != null && !mAccount.type
.equals(SimAccountType.ACCOUNT_TYPE)))) {