diff --git a/mithril.js b/mithril.js index 1ce8d2e9..f8506cba 100644 --- a/mithril.js +++ b/mithril.js @@ -393,7 +393,7 @@ Mithril = m = new function app(window, undefined) { } m.prop = function (store) { - if ((typeof store === 'object' || typeof store === 'function') && + if ((typeof store === 'object' || typeof store === 'function') && store !== null && typeof store.then === 'function') { var prop = _prop() newPromisedProp(prop, store).then(prop) diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index 98fc77a0..f8f7e5ba 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -1508,6 +1508,10 @@ function testMithril(mock) { return prop() === "test2" }) + test(function() { + var prop = m.prop(null) + return prop() === null + }) //m.request test(function() {