Browse Source

refactor: add null check in upgrader

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/1774/head
Pranav C 3 years ago
parent
commit
6dfab9df8f
  1. 10
      packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts

10
packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts

@ -1112,15 +1112,15 @@ async function migrateSharedViews(ctx: MigrateCtxV1, ncMeta: any) {
if (sharedView.view_type !== 'table' && sharedView.view_type !== 'view') { if (sharedView.view_type !== 'table' && sharedView.view_type !== 'view') {
fk_view_id = fk_view_id =
ctx.objViewRef[sharedView.project_id][sharedView.model_name][ ctx.objViewRef[sharedView.project_id]?.[sharedView.model_name]?.[
sharedView.view_name sharedView.view_name
]?.id; ]?.id;
} else { } else {
fk_view_id = fk_view_id =
ctx.objViewRef[sharedView.project_id][sharedView.model_name][ ctx.objViewRef[sharedView.project_id]?.[sharedView.model_name]?.[
ctx.objModelRef[sharedView.project_id][sharedView.model_name].title ctx.objModelRef[sharedView.project_id]?.[sharedView.model_name]?.title
].id || ]?.id ||
ctx.objViewRef[sharedView.project_id][sharedView.model_name][ ctx.objViewRef[sharedView.project_id]?.[sharedView.model_name]?.[
sharedView.model_name sharedView.model_name
]?.id; ]?.id;
} }

Loading…
Cancel
Save