diff --git a/common/changes/@visactor/vtable/fix-add-row-column-plugin-release-error_2026-05-17-02-59.json b/common/changes/@visactor/vtable/fix-add-row-column-plugin-release-error_2026-05-17-02-59.json new file mode 100644 index 000000000..723093a2d --- /dev/null +++ b/common/changes/@visactor/vtable/fix-add-row-column-plugin-release-error_2026-05-17-02-59.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: add optional chaining in AddRowColumnPlugin release to prevent errors\n\n", + "type": "none", + "packageName": "@visactor/vtable" + } + ], + "packageName": "@visactor/vtable", + "email": "wangkyrin@gmail.com" +} \ No newline at end of file diff --git a/packages/vtable-plugins/src/add-row-column.ts b/packages/vtable-plugins/src/add-row-column.ts index 485608a80..2ca92b178 100644 --- a/packages/vtable-plugins/src/add-row-column.ts +++ b/packages/vtable-plugins/src/add-row-column.ts @@ -457,13 +457,13 @@ export class AddRowColumnPlugin implements pluginsDefinition.IVTablePlugin { } // #endregion release() { - this.leftDotForAddColumn.remove(); - this.rightDotForAddColumn.remove(); - this.addIconForAddColumn.remove(); - this.addLineForAddColumn.remove(); - this.topDotForAddRow.remove(); - this.bottomDotForAddRow.remove(); - this.addIconForAddRow.remove(); - this.addLineForAddRow.remove(); + this.leftDotForAddColumn?.remove(); + this.rightDotForAddColumn?.remove(); + this.addIconForAddColumn?.remove(); + this.addLineForAddColumn?.remove(); + this.topDotForAddRow?.remove(); + this.bottomDotForAddRow?.remove(); + this.addIconForAddRow?.remove(); + this.addLineForAddRow?.remove(); } }