Browse Source

fix: check colOptions defined

pull/7392/head
Pranav C 10 months ago
parent
commit
6b0e97e182
  1. 2
      packages/nc-gui/utils/columnUtils.ts

2
packages/nc-gui/utils/columnUtils.ts

@ -184,6 +184,8 @@ const isColumnRequired = (col?: ColumnType) => col && col.rqd && !col.cdf && !co
const isVirtualColRequired = (col: ColumnType, columns: ColumnType[]) =>
col.uidt === UITypes.LinkToAnotherRecord &&
// in some cases we just have type and name so we need to confirm colOptions is there
col.colOptions &&
(<LinkToAnotherRecordType>col.colOptions).type === RelationTypes.BELONGS_TO &&
isColumnRequired(columns.find((c) => c.id === (<LinkToAnotherRecordType>col.colOptions).fk_child_column_id))

Loading…
Cancel
Save