added error check for null.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5321 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-10-19 17:32:19 +00:00
1 parent 58ddeb1fb4
commit bdff42544c
1 file changed
+4 -1
@@ -78,7 +78,10 @@ public abstract class Actionable extends AbstractModelObject {
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) {
for (Action a : getActions()) {
if(a.getUrlName().equals(token))
String urlName = a.getUrlName();
if(urlName==null)
throw new AssertionError("Action "+a+" returned null from the getUrlName() method");
if(urlName.equals(token))
return a;
}
return null;