From a9d21daa6bd65e93c4fcc2c18ba62cf69bfc581f Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 23 Dec 2023 14:00:16 +0530 Subject: [PATCH] fix: handle scenarios where no select options are there Signed-off-by: Pranav C --- packages/nocodb/src/db/BaseModelSqlv2.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 424e523045..785f8d64ca 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -3846,9 +3846,6 @@ class BaseModelSqlv2 { return; } - const options = await column - .getColOptions<{ options: SelectOption[] }>() - .then(({ options }) => options.map((opt) => opt.title)); const columnTitle = column.title; const columnName = column.column_name; const columnValue = @@ -3857,6 +3854,13 @@ class BaseModelSqlv2 { return; } + const options = await column + .getColOptions<{ options: SelectOption[] }>() + .then( + (selectOptionsMeta) => + selectOptionsMeta?.options?.map((opt) => opt.title) || [], + ); + // if multi select, then split the values const columnValueArr = column.uidt === UITypes.MultiSelect