Author: toad
Date: 2008-11-07 17:19:08 +0000 (Fri, 07 Nov 2008)
New Revision: 23378

Modified:
   trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
Log:
Fix a bug preventing config toadlet from being shown if wrapper.conf is 
writable but doesn't have a valid memory limit line.


Modified: trunk/freenet/src/freenet/clients/http/ConfigToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/ConfigToadlet.java   2008-11-07 
15:59:09 UTC (rev 23377)
+++ trunk/freenet/src/freenet/clients/http/ConfigToadlet.java   2008-11-07 
17:19:08 UTC (rev 23378)
@@ -377,18 +377,20 @@
                HTMLNode formNode = ctx.addFormChild(configNode, ".", 
"configForm");

                if(WrapperConfig.canChangeProperties()) {
+                       String configName = "wrapper.java.maxmemory";
+                       String curValue = 
WrapperConfig.getWrapperProperty(configName);
+                       if(curValue != null) {
                        formNode.addChild("div", "class", "configprefix", 
l10n("wrapper"));
                        HTMLNode list = formNode.addChild("ul", "class", 
"config");
                        HTMLNode item = list.addChild("li");
-                       String configName = "wrapper.java.maxmemory";
                        // FIXME how to get the real default???
                        String defaultValue = "128";
-                       String curValue = 
WrapperConfig.getWrapperProperty(configName);
                        item.addChild("span", new String[]{ "class", "title", 
"style" },
                                        new String[]{ "configshortdesc", 
L10n.getString("ConfigToadlet.defaultIs", new String[] { "default" }, new 
String[] { defaultValue }),
                                        "cursor: help;" 
}).addChild(L10n.getHTMLNode("WrapperConfig."+configName+".short"));
                        item.addChild("span", "class", 
"config").addChild("input", new String[] { "type", "class", "name", "value" }, 
new String[] { "text", "config", configName, curValue });
                        item.addChild("span", "class", 
"configlongdesc").addChild(L10n.getHTMLNode("WrapperConfig."+configName+".long"));
+                       }
                }

                for(int i=0; i<sc.length;i++){


Reply via email to