From a3f5f781d7f502c040dd2baacd225f308446bff6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 13 Apr 2023 15:58:49 +0200 Subject: [PATCH] refactor: order condition check on worker message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/abstract-worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index b588b181..7563e97b 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -85,7 +85,7 @@ export abstract class AbstractWorker< message: MessageValue, fn: (data: Data) => Response ): void { - if (message.data != null && message.id != null) { + if (message.id != null && message.data != null) { // Task message received if (this.opts.async === true) { this.runInAsyncScope(this.runAsync.bind(this), this, fn, message) -- 2.34.1