diff --git a/packages/blaze/materializer.js b/packages/blaze/materializer.js index 40e1338db..0a05ea85a 100644 --- a/packages/blaze/materializer.js +++ b/packages/blaze/materializer.js @@ -93,7 +93,7 @@ var materializeDOMInner = function (htmljs, intoArray, parentView, workStack) { throw new Error("Unexpected object in htmljs: " + htmljs); }; -const isPromiseLike = x => typeof x?.then === 'function'; +const isPromiseLike = x => !!x && typeof x.then === 'function'; function waitForAllAttributesAndContinue(attrs, fn) { const promises = []; diff --git a/packages/spacebars/spacebars-runtime.js b/packages/spacebars/spacebars-runtime.js index 8baabead1..9f7f958b2 100644 --- a/packages/spacebars/spacebars-runtime.js +++ b/packages/spacebars/spacebars-runtime.js @@ -175,7 +175,7 @@ Spacebars.call = function (value/*, args*/) { } }; -const isPromiseLike = x => typeof x?.then === 'function'; +const isPromiseLike = x => !!x && typeof x.then === 'function'; // Call this as `Spacebars.kw({ ... })`. The return value // is `instanceof Spacebars.kw`.