avoid a potential type error

pull/1/head
ansuz 4 years ago
parent be6857e0fd
commit a21c3372c0

@ -17,7 +17,7 @@ module.exports = function () {
var next = function (id) { var next = function (id) {
setTimeout(function () { 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(); var task = map[id].shift();
task(fix1(next, id)); task(fix1(next, id));
}); });

Loading…
Cancel
Save