diff --git a/web/app/components/base/file-uploader/utils.ts b/web/app/components/base/file-uploader/utils.ts index 8c752fde8ab858..a04d6359d35e9b 100644 --- a/web/app/components/base/file-uploader/utils.ts +++ b/web/app/components/base/file-uploader/utils.ts @@ -158,13 +158,13 @@ export const isAllowedFileExtension = (fileName: string, fileMimetype: string, a export const getFilesInLogs = (rawData: any) => { const result = Object.keys(rawData || {}).map((key) => { - if (typeof rawData[key] === 'object' && rawData[key].dify_model_identity === '__dify__file__') { + if (typeof rawData[key] === 'object' && rawData[key]?.dify_model_identity === '__dify__file__') { return { varName: key, list: getProcessedFilesFromResponse([rawData[key]]), } } - if (Array.isArray(rawData[key]) && rawData[key].some(item => item.dify_model_identity === '__dify__file__')) { + if (Array.isArray(rawData[key]) && rawData[key].some(item => item?.dify_model_identity === '__dify__file__')) { return { varName: key, list: getProcessedFilesFromResponse(rawData[key]), diff --git a/web/app/components/workflow/run/output-panel.tsx b/web/app/components/workflow/run/output-panel.tsx index 9904079eda5bb4..a1667d9b456525 100644 --- a/web/app/components/workflow/run/output-panel.tsx +++ b/web/app/components/workflow/run/output-panel.tsx @@ -35,12 +35,12 @@ const OutputPanel: FC = ({ for (const key in outputs) { if (Array.isArray(outputs[key])) { outputs[key].map((output: any) => { - if (output.dify_model_identity === '__dify__file__') + if (output?.dify_model_identity === '__dify__file__') fileList.push(output) return null }) } - else if (outputs[key].dify_model_identity === '__dify__file__') { + else if (outputs[key]?.dify_model_identity === '__dify__file__') { fileList.push(outputs[key]) } }