diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java index 18005a83e7a229ad439d0864dcaa9e191103ea5b..a1204f39339fd6e668637225233a4fa3d5585329 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java @@ -108,7 +108,7 @@ public class ConfigClientsHandler extends FormHandler { int newClient = clients.size(); String newDesc = getString("desc" + newClient); - if (newDesc != null) { + if (newDesc != null && newDesc.trim().length() > 0) { // new entry int spc = newDesc.indexOf(" "); String clss = newDesc; @@ -118,7 +118,7 @@ public class ConfigClientsHandler extends FormHandler { args = newDesc.substring(spc + 1); } String name = getString("name" + newClient); - if (name == null) name = "new client"; + if (name == null || name.trim().length() <= 0) name = "new client"; ClientAppConfig ca = new ClientAppConfig(clss, name, args, 2*60*1000, _settings.get(newClient + ".enabled") != null); clients.add(ca); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java index b6d253745ce448a9be61a039a81b18fa759b5506..acef26f7211c4b70f31882c0e020590abf8a3abc 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java @@ -79,10 +79,12 @@ public class ConfigClientsHelper extends HelperBase { buf.append("<a href=\"").append(link).append("\">").append(_(name)).append("</a>"); } else if (edit && !ro) { buf.append("<input type=\"text\" name=\"name").append(index).append("\" value=\""); - buf.append(_(name)); + if (name.length() > 0) + buf.append(_(name)); buf.append("\" >"); } else { - buf.append(_(name)); + if (name.length() > 0) + buf.append(_(name)); } buf.append("</td><td align=\"center\" width=\"10%\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\" value=\"true\" "); if (enabled) { diff --git a/core/java/src/net/i2p/util/Translate.java b/core/java/src/net/i2p/util/Translate.java index 4ff97437d66a89c73f0239663b3642aef29f4f89..c9072b62f5f7e79ff1c0db8ad5c029254f19cb97 100644 --- a/core/java/src/net/i2p/util/Translate.java +++ b/core/java/src/net/i2p/util/Translate.java @@ -36,6 +36,9 @@ public abstract class Translate { return key; else if (lang.equals(TEST_LANG)) return TEST_STRING; + // shouldnt happen but dont dump the po headers if it does + if (key.equals("")) + return key; ResourceBundle bundle = findBundle(bun, lang); if (bundle == null) return key;