Skip to content

Commit 46e592e

Browse files
committed
Fix possible NPE
1 parent fff33b3 commit 46e592e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2258,7 +2258,8 @@ public void handle(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
22582258

22592259
final boolean validStatus = response.getStatus().equals(status);
22602260
final boolean validUpgrade = response.getHeader(HttpHeaders.Names.UPGRADE) != null;
2261-
final boolean validConnection = response.getHeader(HttpHeaders.Names.CONNECTION).equals(HttpHeaders.Values.UPGRADE);
2261+
String c = response.getHeader(HttpHeaders.Names.CONNECTION);
2262+
final boolean validConnection = c == null ? false : c.equals(HttpHeaders.Values.UPGRADE);
22622263

22632264
s = new ResponseStatus(future.getURI(), response, NettyAsyncHttpProvider.this);
22642265
final boolean statusReceived = h.onStatusReceived(s) == STATE.UPGRADE;

0 commit comments

Comments
 (0)