fix: 修复追溯码面板 outboundTarget 为空时 getOutImages 空指针导致列表崩溃
This commit is contained in:
@@ -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,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user