Skip to content

Commit

Permalink
修复一个可能因空安全导致的程序奔溃bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaojieonly committed Jan 23, 2022
1 parent c4614de commit 955882e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/java/com/hippo/network/EhSSLSocketFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ public Socket createSocket(Socket s, String host, int port, boolean autoClose) t
return ((SSLSocketFactory) getDefault()).createSocket(s, host, port, autoClose);
}
InetAddress address = s.getInetAddress();
Log.d("EhSSLSocketFactory", "Host: " + host + " Address: " + address.getHostAddress());
String hostAddress = address.getHostAddress();
if (hostAddress != null){
Log.d("EhSSLSocketFactory", "Host: " + host + " Address: " + hostAddress);
}
if (autoClose) s.close();
return getDefault().createSocket(address, port);
}
Expand Down

0 comments on commit 955882e

Please sign in to comment.