From 72b705b918313867e1149f843f940c9010be32d5 Mon Sep 17 00:00:00 2001 From: pelonpelon Date: Thu, 25 Jun 2015 18:25:49 -0500 Subject: [PATCH] mithril.js: fix if clause that expects truthy value. issue: #689 When key=0 the if statement doesn't do what is intended. --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index eba9b40c..d3cf0d7e 100644 --- a/mithril.js +++ b/mithril.js @@ -248,7 +248,7 @@ var m = (function app(window, undefined) { var key = data && data.attrs && data.attrs.key; data = (pendingRequests == 0 || forcing) || (cached && cached.controllers && cached.controllers.indexOf(controller) > -1) ? data.view(controller) : {tag: "placeholder"}; if (data.subtree === "retain") return cached; - if (key) { + if (typeof key !== 'undefined' && key !== null) { if (!data.attrs) data.attrs = {}; data.attrs.key = key; }