Skip to content

Commit

Permalink
fix: add defense for view in transform plugin (#3092)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Dec 24, 2022
1 parent c250cab commit fb8098c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/x6-plugin-transform/src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ export class TransformImpl extends View<TransformImpl.EventArgs> {

render() {
this.renderHandles()
this.view.addClass(Private.NODE_CLS)

if (this.view) {
this.view.addClass(Private.NODE_CLS)
}

Dom.addClass(this.container, this.containerClassName)
Dom.toggleClass(
this.container,
Expand Down Expand Up @@ -153,7 +157,9 @@ export class TransformImpl extends View<TransformImpl.EventArgs> {
}

remove() {
this.view.removeClass(Private.NODE_CLS)
if (this.view) {
this.view.removeClass(Private.NODE_CLS)
}
return super.remove()
}

Expand Down

0 comments on commit fb8098c

Please sign in to comment.