diff --git a/web/src/components/MarkdownEditorWithPreview/MarkdownEditorWithPreview.tsx b/web/src/components/MarkdownEditorWithPreview/MarkdownEditorWithPreview.tsx index a6053e14c..a20e2cfb1 100644 --- a/web/src/components/MarkdownEditorWithPreview/MarkdownEditorWithPreview.tsx +++ b/web/src/components/MarkdownEditorWithPreview/MarkdownEditorWithPreview.tsx @@ -478,8 +478,12 @@ export function MarkdownEditorWithPreview({ variation={ButtonVariation.PRIMARY} disabled={false} onClick={() => { - handleUpload(file as File, setMarkdownContent, repoMetadata, showError, standalone, routingId) - setOpen(false) + if (file !== undefined) { + handleUpload(file as File, setMarkdownContent, repoMetadata, showError, standalone, routingId) + setOpen(false) + } else { + showError(getString('uploadAFileError')) + } }} />