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 1 year ago
parent
commit
1c304a2285
  1. 6
      packages/nocodb/src/models/View.ts

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

@ -126,8 +126,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);

Loading…
Cancel
Save