From 9ddabcc54e5fa0129151aa91aaa17d1e4f83be6d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 21 Jun 2023 12:12:49 +0530 Subject: [PATCH] fix: handle null case Signed-off-by: Pranav C --- packages/nocodb/src/models/View.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); }