diff --git a/core/src/main/java/hudson/model/Executor.java b/core/src/main/java/hudson/model/Executor.java index 2c6e66414ba97aa0d7ab1eb70738934dc7aa2a00..dfcb32a9ee6fe9a39d5518ab492694ff6e814d86 100644 --- a/core/src/main/java/hudson/model/Executor.java +++ b/core/src/main/java/hudson/model/Executor.java @@ -36,6 +36,7 @@ import jenkins.model.CauseOfInterruption; import jenkins.model.CauseOfInterruption.UserInterruption; import jenkins.model.InterruptedBuildAction; import jenkins.model.Jenkins; +import org.acegisecurity.AccessDeniedException; import org.acegisecurity.Authentication; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.HttpResponses; @@ -892,6 +893,12 @@ public class Executor extends Thread implements ModelObject { lock.readLock().lock(); try { return executable != null && getParentOf(executable).getOwnerTask().hasAbortPermission(); + } catch(Exception ex) { + if (!(ex instanceof AccessDeniedException)) { + // Prevents UI from exploding in the case of unexpected runtime exceptions + LOGGER.log(WARNING, "Unhandled exception", ex); + } + return false; } finally { lock.readLock().unlock(); }