From ea7c26ce71d2e9edeee73a3e5c213bb549661645 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 26 Jan 2022 14:46:49 +0300 Subject: [PATCH] toLoad is always an array --- js/worker-util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/worker-util.js b/js/worker-util.js index 848dc76a..3f40bc67 100644 --- a/js/worker-util.js +++ b/js/worker-util.js @@ -78,7 +78,7 @@ if (self.WorkerGlobalScope) { const toLoad = (Array.isArray(urls) ? urls : [urls]) .map(u => u.endsWith('.js') ? u : u + '.js') .filter(u => !loadedUrls.includes(u)); - if (toLoad) { + if (toLoad.length) { loadedUrls.push(...toLoad); importScripts(...toLoad); }