Skip to content

Build your personal knowledge base with Trilium Notes

chore(client): fix type error

Elian Doranfc98240614cf
diff --git a/apps/client/src/widgets/view_widgets/table_view/col_editing.ts b/apps/client/src/widgets/view_widgets/table_view/col_editing.ts
index 2d3fe5b66b..7ee141e66c 100644
--- a/apps/client/src/widgets/view_widgets/table_view/col_editing.ts
+++ b/apps/client/src/widgets/view_widgets/table_view/col_editing.ts
@@ -31,11 +31,12 @@ export default class TableColumnEditing extends Component {
addNewTableColumnCommand({ referenceColumn, columnToEdit, direction }: EventData<"addNewTableColumn">) {
let attr: Attribute | undefined;
+ this.existingAttributeToEdit = undefined;
if (columnToEdit) {
attr = this.getAttributeFromField(columnToEdit.getField());
- this.existingAttributeToEdit = { ...attr };
- } else {
- this.existingAttributeToEdit = undefined;
+ if (attr) {
+ this.existingAttributeToEdit = { ...attr };
+ }
}
if (!attr) {