diff --git a/src/templates/core/CancelablePromise.hbs b/src/templates/core/CancelablePromise.hbs index e5c7f0d6..b7db949b 100644 --- a/src/templates/core/CancelablePromise.hbs +++ b/src/templates/core/CancelablePromise.hbs @@ -120,7 +120,7 @@ export class CancelablePromise implements Promise { } } this.#cancelHandlers.length = 0; - this.#reject?.(new CancelError('Request aborted')); + if (this.#reject) this.#reject(new CancelError('Request aborted')); } public get isCancelled(): boolean {