diff --git a/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx b/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx index a1273331..bb042784 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/markdown/ChatMarkdownRender.tsx @@ -146,10 +146,12 @@ const CodespanWithLink = ({ text, rawText, chatMessageLocation }: { text: string } const onClick = () => { - if (!link || !link.selection) return; - + if (!link) return; // Use the updated voidOpenFileFn to open the file and handle selection - voidOpenFileFn(link.uri, accessor, [link.selection.startLineNumber, link.selection.endLineNumber]); + if (link.selection) + voidOpenFileFn(link.uri, accessor, [link.selection.startLineNumber, link.selection.endLineNumber]); + else + voidOpenFileFn(link.uri, accessor); } return