Fix NPE raised by HttpHeaders.equalsIgnoreCases() when one of its arguments is null

This commit is contained in:
Trustin Lee 2013-11-28 15:51:13 +09:00
parent b067566a7c
commit d4fd7ff458

View File

@ -1176,6 +1176,10 @@ public abstract class HttpHeaders implements Iterable<Map.Entry<String, String>>
return true; return true;
} }
if (name1 == null || name2 == null) {
return false;
}
int nameLen = name1.length(); int nameLen = name1.length();
if (nameLen != name2.length()) { if (nameLen != name2.length()) {
return false; return false;