Author: nextgens
Date: 2008-07-27 07:55:59 +0000 (Sun, 27 Jul 2008)
New Revision: 21433

Modified:
   trunk/freenet/src/freenet/l10n/L10n.java
Log:
l10n: prevent a potential npe (in case we remove a key from the l10n file from 
one version to another)

Modified: trunk/freenet/src/freenet/l10n/L10n.java
===================================================================
--- trunk/freenet/src/freenet/l10n/L10n.java    2008-07-26 23:53:01 UTC (rev 
21432)
+++ trunk/freenet/src/freenet/l10n/L10n.java    2008-07-27 07:55:59 UTC (rev 
21433)
@@ -116,7 +116,8 @@

                        // If there is no need to keep it in the override, 
remove it...
                        // unless the original/default is the same as the 
translation
-                       if (("".equals(value)) || 
(value.equals(currentTranslation.get(key)))) {
+                       String currentValue = currentTranslation.get(key);
+                       if (("".equals(value)) || ((currentValue != null) && 
(value.equals(currentValue)))) {
                                translationOverride.removeValue(key);
                        } else {
                                value = value.replaceAll("(\r|\n|\t)+", "");


Reply via email to