Browse Source

fix: handle null cases everywhere

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

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

@ -327,8 +327,10 @@ export default class Model implements TableType {
table_name, table_name,
}, },
); );
modelData.meta = parseMetaProp(modelData); if (modelData) {
await NocoCache.set(`${CacheScope.MODEL}:${modelData.id}`, modelData); modelData.meta = parseMetaProp(modelData);
await NocoCache.set(`${CacheScope.MODEL}:${modelData.id}`, modelData);
}
// modelData.filters = await Filter.getFilterObject({ // modelData.filters = await Filter.getFilterObject({
// viewId: modelData.id // viewId: modelData.id
// }); // });

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

@ -207,8 +207,10 @@ export default class View implements ViewType {
}, },
null, null,
); );
view.meta = parseMetaProp(view); if (view) {
await NocoCache.set(`${CacheScope.VIEW}:${fk_model_id}:default`, view); view.meta = parseMetaProp(view);
await NocoCache.set(`${CacheScope.VIEW}:${fk_model_id}:default`, view);
}
} }
return view && new View(view); return view && new View(view);
} }

Loading…
Cancel
Save