mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 02:35:12 +00:00
fix: Cannot read properties of undefined (reading 'pk')
This commit is contained in:
@@ -477,13 +477,18 @@ function fieldsValidation(record: Record<string, any>, tn: string) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (srcDestMapping.value[tn].filter((v: Record<string, any>) => v.destCn === record.destCn).length > 1) {
|
||||
if ((srcDestMapping.value[tn] || []).filter((v: Record<string, any>) => v.destCn === record.destCn).length > 1) {
|
||||
message.error(t('msg.error.duplicateMappingFound'))
|
||||
return false
|
||||
}
|
||||
|
||||
const v = columns.value.find((c) => c.title === record.destCn) as Record<string, any>
|
||||
|
||||
if (!v) {
|
||||
message.error(`Column '${record.destCn}' not found`)
|
||||
return false
|
||||
}
|
||||
|
||||
for (const tableName of Object.keys(importData)) {
|
||||
// check if the input contains null value for a required column
|
||||
if (v.pk ? !v.ai && !v.cdf : !v.cdf && v.rqd) {
|
||||
|
||||
Reference in New Issue
Block a user