check for key != null
This commit is contained in:
parent
e7f2be06ad
commit
977b8210cc
@ -168,9 +168,12 @@ public class MusicAlphabetIndexer {
|
|||||||
mDataCursor.moveToPosition(savedCursorPos);
|
mDataCursor.moveToPosition(savedCursorPos);
|
||||||
|
|
||||||
String[] alphabet = ALPHABET_KEYS;
|
String[] alphabet = ALPHABET_KEYS;
|
||||||
for (int i = 1, len = alphabet.length; i != len; ++i) {
|
|
||||||
if (key.startsWith(alphabet[i]))
|
if (key != null) { // can this really be null? google thinks so :-/
|
||||||
return i;
|
for (int i = 1, len = alphabet.length; i != len; ++i) {
|
||||||
|
if (key.startsWith(alphabet[i]))
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user