Fix value === null in WCF.Language.get
authorTim Düsterhus <duesterhus@woltlab.com>
Sun, 21 Apr 2013 10:32:56 +0000 (12:32 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Sun, 21 Apr 2013 10:34:08 +0000 (12:34 +0200)
wcfsetup/install/files/js/WCF.js

index 9b4b5eaa948c19711de51fb960689a29048bb109..3e00eb43058c425959379630e88511112ab5c67d 100755 (executable)
@@ -2558,7 +2558,11 @@ WCF.Language = {
                
                var value = this._variables.get(key);
                
-               if (typeof value === 'string') {
+               if (value === null) {
+                       // return key again
+                       return key;
+               }
+               else if (typeof value === 'string') {
                        // transform strings into template and try to refetch
                        this.add(key, new WCF.Template(value));
                        return this.get(key, parameters);
@@ -2567,10 +2571,6 @@ WCF.Language = {
                        // evaluate templates
                        value = value.fetch(parameters);
                }
-               else if (value === null) {
-                       // return key again
-                       return key;
-               }
                
                return value;
        }