No need to show an option if there's only one choice.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9423 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-05-19 00:02:34 +00:00
1 parent b29a6a1d73
commit e544f4dbd5
2 files changed
+23 -18

No files matched your search

+3 -1
View File
@@ -1534,7 +1534,9 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node,
private <T extends Describable<T>> T newDescribedChild(StaplerRequest req, JSONObject j,
String name, List<Descriptor<T>> descriptors)
throws FormException {
final String clazz = j.get(name + "Class").toString();
if(!j.has(name + "Class")) return null;
final String clazz = j.getString(name + "Class");
final JSONObject data = j.getJSONObject(name);
j.remove(name + "Class");
j.remove(name);