From f761f9215c2350145ef1559a61cdf26c62ffef09 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 7 Jan 2015 00:53:34 -0700 Subject: [PATCH] fix #1 check for null / undefined result --- forEachAsync.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forEachAsync.js b/forEachAsync.js index a309285..ef034ac 100644 --- a/forEachAsync.js +++ b/forEachAsync.js @@ -26,7 +26,7 @@ ret = result = fn(item, k, arr); } - if (!ret.then) { + if (!ret || !ret.then) { ret = PromiseA.resolve(result); }