mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-05 08:10:30 +00:00
fix: handle undefined file.url in UserMessage to prevent TypeError (#20343)
Add optional chaining to file.url.startsWith() calls to safely handle cases where file.url is undefined, preventing 'can't access property startsWith' TypeError in user messages with file attachments.
This commit is contained in:
parent
ccd3295a5d
commit
cfecca8eda
1 changed files with 1 additions and 1 deletions
|
|
@ -194,7 +194,7 @@
|
|||
>
|
||||
{#each message.files as file}
|
||||
{@const fileUrl =
|
||||
file.url.startsWith('data') || file.url.startsWith('http')
|
||||
file.url?.startsWith('data') || file.url?.startsWith('http')
|
||||
? file.url
|
||||
: `${WEBUI_API_BASE_URL}/files/${file.url}${file?.content_type ? '/content' : ''}`}
|
||||
<div class={($settings?.chatBubble ?? true) ? 'self-end' : ''}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue