Skip to content

Commit 32bf1f7

Browse files
committed
Just because a file is empty does not mean it failed to load
1 parent c9ee0d2 commit 32bf1f7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/array/src/renderer/features/code-editor/components/CodeEditorPanel.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,15 @@ export function CodeEditorPanel({
5050
return <PanelMessage>Loading file...</PanelMessage>;
5151
}
5252

53-
if (error || !fileContent) {
53+
if (error || fileContent == null) {
5454
return <PanelMessage>Failed to load file</PanelMessage>;
5555
}
5656

57+
// If we ever allow editing in the CodeMirrorEditor, this can be removed
58+
if (fileContent.length === 0) {
59+
return <PanelMessage>File is empty</PanelMessage>;
60+
}
61+
5762
return (
5863
<Box height="100%" style={{ overflow: "hidden" }}>
5964
<CodeMirrorEditor

0 commit comments

Comments
 (0)