Browse Source

fix: handle non-existing view id in view get method

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5901/head
Pranav C 2 years ago
parent
commit
1c304a2285
  1. 2
      packages/nocodb/src/models/View.ts

2
packages/nocodb/src/models/View.ts

@ -126,9 +126,11 @@ export default class View implements ViewType {
));
if (!view) {
view = await ncMeta.metaGet2(null, null, MetaTable.VIEWS, viewId);
if (view) {
view.meta = parseMetaProp(view);
await NocoCache.set(`${CacheScope.VIEW}:${view.id}`, view);
}
}
return view && new View(view);
}

Loading…
Cancel
Save