diff --git a/packages/x6-plugin-transform/src/transform.ts b/packages/x6-plugin-transform/src/transform.ts index 38588657a39..39df90b9d7a 100644 --- a/packages/x6-plugin-transform/src/transform.ts +++ b/packages/x6-plugin-transform/src/transform.ts @@ -107,7 +107,11 @@ export class TransformImpl extends View { 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, @@ -153,7 +157,9 @@ export class TransformImpl extends View { } remove() { - this.view.removeClass(Private.NODE_CLS) + if (this.view) { + this.view.removeClass(Private.NODE_CLS) + } return super.remove() }