diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 9e13aeebcbbcb64d364152abe31476fe2f33cbe6..e3ef07269cb9aa519b01f5bea659045a9d4376e1 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -866,6 +866,7 @@ public class Functions { */ public static String getActionUrl(String itUrl,Action action) { String urlName = action.getUrlName(); + if(urlName==null) return null; // to avoid NPE and fail to render the whole page if(SCHEME.matcher(urlName).matches()) return urlName; // absolute URL diff --git a/core/src/main/java/hudson/model/Action.java b/core/src/main/java/hudson/model/Action.java index c77bd1410fdcedbdf1a14af372918cdf065d60e2..89b2065076a11371cec8f02cae903fe5b879caa4 100644 --- a/core/src/main/java/hudson/model/Action.java +++ b/core/src/main/java/hudson/model/Action.java @@ -71,7 +71,8 @@ public interface Action extends ModelObject { * which is useful for directly connecting to external systems. * * @return - * null if this action object doesn't need to be bound to web. + * null if this action object doesn't need to be bound to web + * (when you do that, be sure to also return null from {@link #getIconFileName()}. */ String getUrlName(); }