From: Jérôme Benoit Date: Thu, 13 Apr 2023 13:58:49 +0000 (+0200) Subject: refactor: order condition check on worker message X-Git-Tag: v2.4.9~31 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a3f5f781d7f502c040dd2baacd225f308446bff6;p=poolifier.git refactor: order condition check on worker message Signed-off-by: Jérôme Benoit --- 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)