1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-22 15:42:00 +03:00

Merge pull request #513 from adamsp/master

Fix for NPE when the OpenSSLSocketImpl returns null from getNpnSelectedProtocol
This commit is contained in:
Adrian Cole
2014-02-06 01:36:25 +01:00

View File

@@ -293,7 +293,9 @@ public class Platform {
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) {