提交 ac41f574 编写于 作者: K kohsuke

fixed NPE as reported in #1270


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7035 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1064190d
......@@ -26,7 +26,10 @@ public class Executor extends Thread implements ModelObject {
* Executor number that identifies it among other executors for the same {@link Computer}.
*/
private int number;
private Queue.Executable executable;
/**
* {@link Queue.Executable} being executed right now, or null if the executor is idle.
*/
private volatile Queue.Executable executable;
private Throwable causeOfDeath;
......@@ -167,7 +170,8 @@ public class Executor extends Thread implements ModelObject {
* Checks if the current user has a permission to stop this build.
*/
public boolean hasStopPermission() {
return executable.getParent().hasAbortPermission();
Queue.Executable e = executable;
return e!=null && e.getParent().hasAbortPermission();
}
public Computer getOwner() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册