From a21c3372c010503407d250ee93ccd6adbc736073 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 23 Jul 2020 09:27:29 -0400 Subject: [PATCH] avoid a potential type error --- lib/write-queue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/write-queue.js b/lib/write-queue.js index c82b12b3b..912eceb01 100644 --- a/lib/write-queue.js +++ b/lib/write-queue.js @@ -17,7 +17,7 @@ module.exports = function () { var next = function (id) { setTimeout(function () { - if (map[id] && map[id].length === 0) { return void delete map[id]; } + if (!map[id] || map[id].length === 0) { return void delete map[id]; } var task = map[id].shift(); task(fix1(next, id)); });