check store nullity in m.prop
This commit is contained in:
parent
f803da2008
commit
fd7b3e0803
2 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1508,6 +1508,10 @@ function testMithril(mock) {
|
|||
|
||||
return prop() === "test2"
|
||||
})
|
||||
test(function() {
|
||||
var prop = m.prop(null)
|
||||
return prop() === null
|
||||
})
|
||||
|
||||
//m.request
|
||||
test(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue