diff --git a/packages/nocodb/src/models/View.ts b/packages/nocodb/src/models/View.ts index 187a0ee52d..79eda3747d 100644 --- a/packages/nocodb/src/models/View.ts +++ b/packages/nocodb/src/models/View.ts @@ -127,8 +127,10 @@ export default class View implements ViewType { )); if (!view) { view = await ncMeta.metaGet2(null, null, MetaTable.VIEWS, viewId); - view.meta = parseMetaProp(view); - await NocoCache.set(`${CacheScope.VIEW}:${view.id}`, view); + if (view) { + view.meta = parseMetaProp(view); + await NocoCache.set(`${CacheScope.VIEW}:${view.id}`, view); + } } return view && new View(view); @@ -1273,7 +1275,7 @@ export default class View implements ViewType { ); } - async delete(ncMeta = Noco.ncMeta){ + async delete(ncMeta = Noco.ncMeta) { await View.delete(this.id, ncMeta); }