提交 c7c80705 编写于 作者: K kohsuke

fixed an NPE when removing a slave.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2329 71c3de6d-444a-0410-be80-ed276b4c234a
上级 c3e64473
......@@ -372,8 +372,9 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
/*package*/ void removeComputer(Computer computer) {
Iterator<Entry<Node,Computer>> itr=computers.entrySet().iterator();
while(itr.hasNext()) {
if(itr.next().getValue()==computer) {
itr.remove();
Entry<Node, Computer> e = itr.next();
if(e.getValue()==computer) {
computers.remove(e.getKey());
return;
}
}
......@@ -506,7 +507,7 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node
public int compare(Computer lhs, Computer rhs) {
if(lhs.getNode()==Hudson.this) return -1;
if(rhs.getNode()==Hudson.this) return 1;
return lhs.getNode().getNodeName().compareTo(rhs.getNode().getNodeName());
return lhs.getDisplayName().compareTo(rhs.getDisplayName());
}
});
return r;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册