diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 00a7aae3..eebf7743 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -519,7 +519,7 @@ .filter((message) => message) .map((message, idx, arr) => ({ role: message.role, - ...(message.files.filter((file) => file.type === 'image') + ...(message.files?.filter((file) => file.type === 'image').length > 0 ?? false ? { content: [ { diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 5b08c4c3..c161435d 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -530,7 +530,7 @@ .filter((message) => message) .map((message, idx, arr) => ({ role: message.role, - ...(message.files.filter((file) => file.type === 'image') + ...(message.files?.filter((file) => file.type === 'image').length > 0 ?? false ? { content: [ {