diff --git a/src/client/common/utils/async.ts b/src/client/common/utils/async.ts index 29bf4a8d6fca..5905399cd4a1 100644 --- a/src/client/common/utils/async.ts +++ b/src/client/common/utils/async.ts @@ -50,11 +50,17 @@ class DeferredImpl implements Deferred { } public resolve(_value: T | PromiseLike) { + if (this.completed) { + return; + } this._resolve.apply(this.scope ? this.scope : this, [_value]); this._resolved = true; } public reject(_reason?: string | Error | Record) { + if (this.completed) { + return; + } this._reject.apply(this.scope ? this.scope : this, [_reason]); this._rejected = true; }