Check for string type before decode

This commit is contained in:
Mel O'Hagan 2022-10-27 17:55:46 +01:00
parent 5fc8299390
commit 5941b3d64b
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ module External {
// one to many
if (isOneSide(field)) {
let id = row[key][0]
if (isNaN(id)) {
if (typeof row[key] === "string") {
id = decodeURIComponent(row[key]).match(/\[(.*?)\]/)?.[1]
}
newRow[field.foreignKey || linkTablePrimary] = breakRowIdField(id)[0]