From adcf6c853c9ba76ca1b313d2ceb78ffd742ae08b Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Mon, 9 Jun 2014 12:32:32 -0700 Subject: [PATCH] Allow null in inclusion to match devel --- packages/spacebars/spacebars-runtime.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/spacebars/spacebars-runtime.js b/packages/spacebars/spacebars-runtime.js index 254c1f05a4..f260a4a8e2 100644 --- a/packages/spacebars/spacebars-runtime.js +++ b/packages/spacebars/spacebars-runtime.js @@ -1,7 +1,10 @@ Spacebars.include2 = function (templateOrFunction, dataFunc, contentFunc, elseFunc) { var template = Spacebars.call(templateOrFunction); + if (template === null) + return null; + if (! (template instanceof Blaze.Component)) - throw new Error("Expected template, found: " + template); + throw new Error("Expected template or null, found: " + template); return new template.constructor(dataFunc, contentFunc, elseFunc); };