提交 4feb8cae 编写于 作者: lebron2008lebron's avatar lebron2008lebron

npe fix

上级 0144b03b
......@@ -142,18 +142,20 @@ public class MessageExt extends Message {
}
public String getBornHostString() {
if (this.bornHost != null) {
InetSocketAddress inetSocketAddress = (InetSocketAddress) this.bornHost;
return inetSocketAddress.getAddress().getHostAddress();
if (null != this.bornHost) {
InetAddress inetAddress = ((InetSocketAddress) this.bornHost).getAddress();
return null != inetAddress ? inetAddress.getHostAddress() : null;
}
return null;
}
public String getBornHostNameString() {
if (this.bornHost != null) {
InetSocketAddress inetSocketAddress = (InetSocketAddress) this.bornHost;
return inetSocketAddress.getAddress().getHostName();
if (null != this.bornHost) {
InetAddress inetAddress = ((InetSocketAddress) this.bornHost).getAddress();
return null != inetAddress ? inetAddress.getHostName() : null;
}
return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册