avoid NPE in String.equalsIgnoreCase

This commit is contained in:
Joel Dice 2009-07-28 17:00:11 -06:00
parent 5b23ad3f40
commit 8c18f27e89

View File

@ -235,7 +235,7 @@ public final class String
}
public boolean equalsIgnoreCase(String s) {
return this == s || compareToIgnoreCase(s) == 0;
return this == s || (s != null && compareToIgnoreCase(s) == 0);
}
public int compareTo(String s) {