Browse Source

fix: handle null case

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5936/head
Pranav C 1 year ago
parent
commit
9ddabcc54e
  1. 8
      packages/nocodb/src/models/View.ts

8
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);
}

Loading…
Cancel
Save