Skip to content

Commit b0f07cf

Browse files
committed
fix: handle potential error when retrieving original image URL in saveData function
1 parent 1057108 commit b0f07cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

custom/VisionAction.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,12 @@ async function saveData() {
548548
}
549549
if (!overwriteExistingValues.value) {
550550
const imageURL = selected.value.find(rec => rec[primaryKey] === item[primaryKey])[key];
551-
const originalImageUrl = listOfImageThatWasNotGeneratedPerRecord.value[item[primaryKey]][key].originalImage;
551+
let originalImageUrl = ''
552+
try {
553+
originalImageUrl = listOfImageThatWasNotGeneratedPerRecord.value[item[primaryKey]][key].originalImage;
554+
} catch (error) {
555+
originalImageUrl = '';
556+
}
552557
if (originalImageUrl === imageURL) {
553558
reqData.find(rec => rec[primaryKey] === item[primaryKey])[key] = undefined;
554559
continue;

0 commit comments

Comments
 (0)