From 8fccd2128360483ae02f0d5ef95ad21578958ff9 Mon Sep 17 00:00:00 2001 From: wycats Date: Tue, 21 Dec 2010 09:46:50 -0800 Subject: [PATCH] escapeExpressions should return "" for falsy values --- lib/handlebars/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js index bc816d52..d579c0bd 100644 --- a/lib/handlebars/utils.js +++ b/lib/handlebars/utils.js @@ -31,8 +31,8 @@ Handlebars.SafeString.prototype.toString = function() { // don't escape SafeStrings, since they're already safe if (string instanceof Handlebars.SafeString) { return string.toString(); - } else if (string === null) { - string = ""; + } else if (string == null || string === false) { + return ""; } if(!possible.test(string)) { return string; }