From 3bbe1ab9d80854386e774047c16a18f89d3cb60e Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Tue, 13 Dec 2011 21:24:28 -0800 Subject: [PATCH] Fix rendering partials w/o data Thanks drobbins (see https://github.com/janl/mustache.js/pull/113) --- mustache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index 9d5fd01..3db6154 100644 --- a/mustache.js +++ b/mustache.js @@ -139,7 +139,7 @@ var Mustache = function () { if (!partials || partials[name] === undefined) { throw({message: "unknown_partial '" + name + "'"}); } - if (typeof context[name] != "object") { + if (!context || typeof context[name] != "object") { return this.render(partials[name], context, partials, true); } return this.render(partials[name], context[name], partials, true);