diff --git a/packages/g6/src/plugins/snapline/index.ts b/packages/g6/src/plugins/snapline/index.ts index f6469881bd3..bc587fe3833 100644 --- a/packages/g6/src/plugins/snapline/index.ts +++ b/packages/g6/src/plugins/snapline/index.ts @@ -365,8 +365,8 @@ export class Snapline extends BasePlugin { } private destroyElements() { - this.horizontalLine.destroy(); - this.verticalLine.destroy(); + this.horizontalLine?.destroy(); + this.verticalLine?.destroy(); } public destroy() {