Author: nextgens
Date: 2007-04-22 13:27:19 +0000 (Sun, 22 Apr 2007)
New Revision: 12860

Modified:
   trunk/freenet/src/freenet/clients/http/TranslationToadlet.java
Log:
maybe fix mario's NPE

Modified: trunk/freenet/src/freenet/clients/http/TranslationToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/TranslationToadlet.java      
2007-04-22 13:17:57 UTC (rev 12859)
+++ trunk/freenet/src/freenet/clients/http/TranslationToadlet.java      
2007-04-22 13:27:19 UTC (rev 12860)
@@ -145,29 +145,31 @@
                legendRow.addChild("td", "class", "translation-key", "Current 
translation");

                SimpleFieldSet sfs = L10n.getCurrentLanguageTranslation();
-               KeyIterator it = sfs.keyIterator("");
-               
-               while(it.hasNext()) {
-                       String key = it.nextKey();
+               if(sfs != null) {
+                       KeyIterator it = sfs.keyIterator("");

-                       HTMLNode contentRow = legendTable.addChild("tr");
-                       contentRow.addChild("td", "class", "translation-key",
-                                       key
-                       );
-                       contentRow.addChild("td", "class", "translation-orig",
-                                       L10n.getDefaultString(key)
-                       );
+                       while(it.hasNext()) {
+                               String key = it.nextKey();

-                       contentRow.addChild("td", "class", 
"translation-new").addChild(
-                                       "input",
-                                       new String[] { "type", "name", "value" 
},
-                                       new String[] { "text", "trans",  
L10n.getString(key)
-                                       });
+                               HTMLNode contentRow = 
legendTable.addChild("tr");
+                               contentRow.addChild("td", "class", 
"translation-key",
+                                               key
+                               );
+                               contentRow.addChild("td", "class", 
"translation-orig",
+                                               L10n.getDefaultString(key)
+                               );

-                       contentRow.addChild("td", 
-                                       new String[] { "type", "name", "value" 
}, 
-                                       new String[] { "text", "key", key
-                       });
+                               contentRow.addChild("td", "class", 
"translation-new").addChild(
+                                               "input",
+                                               new String[] { "type", "name", 
"value" },
+                                               new String[] { "text", "trans", 
 L10n.getString(key)
+                                               });
+
+                               contentRow.addChild("td", 
+                                               new String[] { "type", "name", 
"value" }, 
+                                               new String[] { "text", "key", 
key
+                               });
+                       }
                }
                this.writeReply(ctx, 200, "text/html; charset=utf-8", "OK", 
pageNode.generate());
        }


Reply via email to