Permalink
Browse files

fixed null value throws error issue in applyReplacement function

  • Loading branch information...
1 parent acad498 commit f1da349593b43d5363a5a2d401d5a8f4fe2a065c @jamuhl jamuhl committed Mar 4, 2013
@@ -765,6 +765,8 @@
}
function applyReplacement(str, replacementHash, nestedKey, options) {
+ if (!str) return str;
+
options = options || replacementHash; // first call uses replacement hash combined with options
if (str.indexOf(options.interpolationPrefix || o.interpolationPrefix) < 0) return str;

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
@@ -761,6 +761,8 @@
}
function applyReplacement(str, replacementHash, nestedKey, options) {
+ if (!str) return str;
+
options = options || replacementHash; // first call uses replacement hash combined with options
if (str.indexOf(options.interpolationPrefix || o.interpolationPrefix) < 0) return str;
Binary file not shown.
@@ -762,6 +762,8 @@
}
function applyReplacement(str, replacementHash, nestedKey, options) {
+ if (!str) return str;
+
options = options || replacementHash; // first call uses replacement hash combined with options
if (str.indexOf(options.interpolationPrefix || o.interpolationPrefix) < 0) return str;
View
@@ -1,4 +1,5 @@
### 1.6.1pre
+- fixed issue with null value throws in applyReplacement function
- fixed issue #80 empty string lookup ends in fallback instead of returning result in language
- fixed issue with null value in resources not returning expected value
- optimized tests to use on server (nodejs) too
View
@@ -1,4 +1,6 @@
function applyReplacement(str, replacementHash, nestedKey, options) {
+ if (!str) return str;
+
options = options || replacementHash; // first call uses replacement hash combined with options
if (str.indexOf(options.interpolationPrefix || o.interpolationPrefix) < 0) return str;

0 comments on commit f1da349

Please sign in to comment.