From 5639ba423bfaa5340bb7b26e56cb22d341f13be5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 18 Feb 2025 18:47:56 -0600 Subject: [PATCH] Fix "Cannot read properties of undefined (reading 'startsWith')" --- src/lib/components/chat/Messages/Markdown/Source.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Messages/Markdown/Source.svelte b/src/lib/components/chat/Messages/Markdown/Source.svelte index 4eb1fffb7..b7c7513ae 100644 --- a/src/lib/components/chat/Messages/Markdown/Source.svelte +++ b/src/lib/components/chat/Messages/Markdown/Source.svelte @@ -2,7 +2,7 @@ export let token; export let onClick: Function = () => {}; - let attributes: Record = {}; + let attributes: Record = {}; function extractAttributes(input: string): Record { const regex = /(\w+)="([^"]*)"/g; @@ -42,6 +42,6 @@ }} > - {formattedTitle(attributes.title)} + {attributes.title ? formattedTitle(attributes.title) : ''}