diff --git a/packages/nocodb/src/models/Column.ts b/packages/nocodb/src/models/Column.ts index e3c78f1b87..cb7911001b 100644 --- a/packages/nocodb/src/models/Column.ts +++ b/packages/nocodb/src/models/Column.ts @@ -837,7 +837,7 @@ export default class Column implements ColumnType { CacheScope.GALLERY_VIEW_COLUMN, ]; - for (let i; i < viewColumnTables.length; i++) { + for (let i = 0; i < viewColumnTables.length; i++) { const table = viewColumnTables[i]; const cacheScope = viewColumnCacheScope[i]; const viewColumns = await ncMeta.metaList2(null, null, table, { diff --git a/packages/nocodb/src/services/views.service.ts b/packages/nocodb/src/services/views.service.ts index 5aeaa8d62e..3b2aa9ea8c 100644 --- a/packages/nocodb/src/services/views.service.ts +++ b/packages/nocodb/src/services/views.service.ts @@ -76,6 +76,10 @@ export class ViewsService { }) { const model = await Model.get(param.tableId); + if (!model) { + NcError.tableNotFound(param.tableId); + } + const viewList = await xcVisibilityMetaGet({ baseId: model.base_id, models: [model],