summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpabs@pablotron.org <pabs@pablotron.org>2014-12-18 01:11:32 -0500
committerpabs@pablotron.org <pabs@pablotron.org>2014-12-18 01:11:32 -0500
commit1593bdcccb6e6dccd0ad3370eea0b16c9d11fb5e (patch)
tree7b7b6cacec519b1888c4d9f30db1c66ba3f1c32f
parente6fea7ce6d25316b850e80183bb2975364a13622 (diff)
downloadluigi-template-1593bdcccb6e6dccd0ad3370eea0b16c9d11fb5e.tar.bz2
luigi-template-1593bdcccb6e6dccd0ad3370eea0b16c9d11fb5e.zip
make all string functions null safe
-rw-r--r--luigi-template.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/luigi-template.js b/luigi-template.js
index cb62c71..55ecf25 100644
--- a/luigi-template.js
+++ b/luigi-template.js
@@ -77,11 +77,11 @@ LuigiTemplate = (function() {
// list of built-in filters
var FILTERS = {
uc: function(v) {
- return v.toUpperCase();
+ return (v || '').toUpperCase();
},
lc: function(v) {
- return v.toLowerCase();
+ return (v || '').toLowerCase();
},
pluralize: function(v) {
@@ -89,7 +89,7 @@ LuigiTemplate = (function() {
},
length: function(v) {
- return v.length;
+ return (v || '').length;
},
trim: function(v) {