OSDN Git Service

Eleven: fix possible NPE
authorMichael W <baddaemon87@gmail.com>
Sat, 18 Jun 2016 20:40:54 +0000 (22:40 +0200)
committerMichael W <baddaemon87@gmail.com>
Sat, 18 Jun 2016 20:40:54 +0000 (22:40 +0200)
Fix for the case when name is null

Change-Id: I90909497129c09f6ab8a4eebd0935c2d38de5b39
Reference: BugDump 13-20160610-16 L#80

src/com/cyanogenmod/eleven/locale/LocaleUtils.java

index f16a17a..4381f71 100644 (file)
@@ -127,6 +127,9 @@ public class LocaleUtils {
          * for the new # bucket, so the returned range becomes 0 to N+1.
          */
         public int getBucketIndex(String name) {
+            if (name == null) {
+                return -1;
+            }
             boolean prefixIsNumeric = false;
             final int length = name.length();
             int offset = 0;