diff --git a/backend/src/RegExpRunner.ts b/backend/src/RegExpRunner.ts index 4aa1e637..ef5f72dd 100644 --- a/backend/src/RegExpRunner.ts +++ b/backend/src/RegExpRunner.ts @@ -68,7 +68,10 @@ export class RegExpRunner extends EventEmitter { if (!this._worker) { this._worker = new RegExpWorker(newWorkerTimeout); if (newWorkerTimeout !== FINAL_REGEX_TIMEOUT) { - regexTimeoutUpgradePromise.then(() => (this._worker.timeout = FINAL_REGEX_TIMEOUT)); + regexTimeoutUpgradePromise.then(() => { + if (!this._worker) return; + this._worker.timeout = FINAL_REGEX_TIMEOUT; + }); } }