diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 67511ab211..88daac903f 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -7504,10 +7504,11 @@ export function _wherePk( } export function getCompositePkValue(primaryKeys: Column[], row) { - if (typeof row !== 'object') return row; - - if (row === null) + if (row === null || row === undefined) { NcError.requiredFieldMissing(primaryKeys.map((c) => c.title).join(',')); + } + + if (typeof row !== 'object') return row; return primaryKeys.map((c) => row[c.title] ?? row[c.column_name]).join('___'); } diff --git a/packages/nocodb/src/helpers/catchError.ts b/packages/nocodb/src/helpers/catchError.ts index 86bb0e37fb..b43c46b39e 100644 --- a/packages/nocodb/src/helpers/catchError.ts +++ b/packages/nocodb/src/helpers/catchError.ts @@ -670,7 +670,9 @@ export class NcError { id: string | string[] | Record | Record[], args?: NcErrorArgs, ) { - if (typeof id === 'string') { + if (!id) { + id = 'unknown'; + } else if (typeof id === 'string') { id = [id]; } else if (Array.isArray(id)) { if (id.every((i) => typeof i === 'string')) {