# HG changeset patch # User michaelm # Date 1518627776 0 # Node ID e2a780d8c6f01287674f8b21520b2684209bbadb # Parent 86e628130926231d08d3fc76bebe3a34acf94564 http-client-branch: Fixed problem in last push in Response.java diff -r 86e628130926 -r e2a780d8c6f0 src/java.net.http/share/classes/jdk/internal/net/http/Response.java --- a/src/java.net.http/share/classes/jdk/internal/net/http/Response.java Wed Feb 14 16:04:18 2018 +0000 +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Response.java Wed Feb 14 17:02:56 2018 +0000 @@ -69,20 +69,25 @@ this.version = version; this.exchange = exchange; this.statusCode = statusCode; - InetSocketAddress a; - try { - a = (InetSocketAddress)connection.channel().getLocalAddress(); - } catch (IOException e) { - a = null; - } - this.localAddress = a; this.isConnectResponse = isConnectResponse; - if (connection != null && connection instanceof AbstractAsyncSSLConnection) { - AbstractAsyncSSLConnection cc = (AbstractAsyncSSLConnection)connection; - SSLEngine engine = cc.getEngine(); - sslSession = Utils.immutableSession(engine.getSession()); + if (connection != null) { + InetSocketAddress a; + try { + a = (InetSocketAddress)connection.channel().getLocalAddress(); + } catch (IOException e) { + a = null; + } + this.localAddress = a; + if (connection instanceof AbstractAsyncSSLConnection) { + AbstractAsyncSSLConnection cc = (AbstractAsyncSSLConnection)connection; + SSLEngine engine = cc.getEngine(); + sslSession = Utils.immutableSession(engine.getSession()); + } else { + sslSession = null; + } } else { sslSession = null; + localAddress = null; } }