提交 d98926ae 编写于 作者: K Kohsuke Kawaguchi

Fixes NPE.

if the root URL isn't configured, clients won't be able to find this, so might as well not advertise at all.
上级 ff90e3de
......@@ -28,8 +28,9 @@ public class DNSMultiCast implements Closeable {
Map<String,String> props = new HashMap<String, String>();
String rootURL = hudson.getRootUrl();
if (rootURL!=null)
props.put("url", rootURL);
if (rootURL==null) return;
props.put("url", rootURL);
try {
props.put("version",String.valueOf(Jenkins.getVersion()));
} catch (IllegalArgumentException e) {
......@@ -50,7 +51,7 @@ public class DNSMultiCast implements Closeable {
if (jenkins_url.getPath().length() > 0) {
props.put("path", jenkins_url.getPath());
}
jmdns.registerService(ServiceInfo.create("_hudson._tcp.local.","hudson",
jenkins_port,0,0,props)); // for backward compatibility
jmdns.registerService(ServiceInfo.create("_jenkins._tcp.local.","jenkins",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册