Skip to content

Commit

Permalink
fix(upload-ctx-provider): check for the context presence before try t…
Browse files Browse the repository at this point in the history
…o unbind from event emitter
  • Loading branch information
nd0ut committed Dec 19, 2023
1 parent b6eca31 commit 372e64f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blocks/UploadCtxProvider/UploadCtxProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class UploadCtxProviderClass extends UploaderBlock {
destroyCallback() {
super.destroyCallback();

this.$['*eventEmitter'].unbindTarget(this);
if (this.has('*eventEmitter')) {
// Context could be destroyed before the block destroy callback called
this.$['*eventEmitter'].unbindTarget(this);
}
}
}

Expand Down

0 comments on commit 372e64f

Please sign in to comment.