From c00610cbc6e80cc942a8d6c2c3632da6fee066b3 Mon Sep 17 00:00:00 2001 From: Christian Ceciliano Date: Thu, 21 Apr 2016 14:08:56 -0500 Subject: [PATCH] Fix crash empty array on empty type --- lib/flash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/flash.js b/lib/flash.js index a278bc1..d26776f 100644 --- a/lib/flash.js +++ b/lib/flash.js @@ -68,7 +68,7 @@ function _flash(type, msg) { msg.forEach(function(val){ (msgs[type] = msgs[type] || []).push(val); }); - return msgs[type].length; + return (msgs[type] = msgs[type] || []).length; } return (msgs[type] = msgs[type] || []).push(msg); } else if (type) {