fix: 修复追溯码面板 outboundTarget 为空时 getOutImages 空指针导致列表崩溃

This commit is contained in:
Nixevol
2026-07-10 17:38:50 +08:00
parent 328c882a90
commit 89b7cd3c7f
+3 -2
View File
@@ -322,7 +322,8 @@ const outboundForm = reactive<any>({
}); });
function rowIsOutbound(row: any) { function rowIsOutbound(row: any) {
return Boolean(row?.outTime || getOutImages(row).length); if (!row) return false;
return Boolean(row.outTime || getOutImages(row).length);
} }
function rowIsOnchain(row: any) { function rowIsOnchain(row: any) {
return Boolean(row?.latestProof); return Boolean(row?.latestProof);
@@ -810,7 +811,7 @@ function fileName(key: string) {
} }
function getOutImages(row: any) { function getOutImages(row: any) {
const list = Array.isArray(row.outImages) ? row.outImages : []; const list = Array.isArray(row?.outImages) ? row.outImages : [];
return list.map((item: any) => return list.map((item: any) =>
typeof item === 'string' ? { key: item, url: item, name: fileName(item), type: 'image' } : item, typeof item === 'string' ? { key: item, url: item, name: fileName(item), type: 'image' } : item,
); );