Return null info if service is not started

Closes #6906
This commit is contained in:
Simon Willnauer 2014-07-17 15:30:51 +02:00
parent 2bec59ec3e
commit 6fc5acd760
2 changed files with 10 additions and 2 deletions

View File

@ -281,7 +281,11 @@ public class NettyHttpServerTransport extends AbstractLifecycleComponent<HttpSer
@Override
public HttpInfo info() {
return new HttpInfo(boundAddress(), maxContentLength.bytes());
BoundTransportAddress boundTransportAddress = boundAddress();
if (boundTransportAddress == null) {
return null;
}
return new HttpInfo(boundTransportAddress, maxContentLength.bytes());
}
@Override

View File

@ -127,7 +127,11 @@ public class TransportService extends AbstractLifecycleComponent<TransportServic
}
public TransportInfo info() {
return new TransportInfo(boundAddress());
BoundTransportAddress boundTransportAddress = boundAddress();
if (boundTransportAddress == null) {
return null;
}
return new TransportInfo(boundTransportAddress);
}
public TransportStats stats() {