Skip to content

Commit

Permalink
Merge pull request square#513 from adamsp/master
Browse files Browse the repository at this point in the history
Fix for NPE when the OpenSSLSocketImpl returns null from getNpnSelectedProtocol
  • Loading branch information
Adrian Cole committed Feb 6, 2014
2 parents 85fbb0a + 0ca4c82 commit 08b68ac
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ private Android(
byte[] alpnResult = (byte[]) getAlpnSelectedProtocol.invoke(socket);
if (alpnResult != null) return ByteString.of(alpnResult);
}
return ByteString.of((byte[]) getNpnSelectedProtocol.invoke(socket));
byte[] npnResult = (byte[]) getNpnSelectedProtocol.invoke(socket);
if (npnResult == null) return null;
return ByteString.of(npnResult);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
Expand Down

0 comments on commit 08b68ac

Please sign in to comment.