Handle empty responses from partials

Fixes #675
This commit is contained in:
kpdecker
2013-12-23 15:33:33 -06:00
parent 23d41e5617
commit 93fb25c702
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -33,7 +33,7 @@ export function template(templateSpec, env) {
// TODO : Check this for all inputs and the options handling (partial flag, etc). This feels
// like there should be a common exec path
var result = invokePartial.apply(this, arguments);
if (result) { return result; }
if (result != null) { return result; }
var options = { helpers: helpers, partials: partials, data: data };
partials[name] = env.compile(partial, { data: data !== undefined }, env);
@@ -42,7 +42,7 @@ export function template(templateSpec, env) {
} else {
invokePartialWrapper = function(partial, name /* , context, helpers, partials, data */) {
var result = invokePartial.apply(this, arguments);
if (result) { return result; }
if (result != null) { return result; }
throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
};
}