From 8deee04a637b589c9ba1acd736ea65a4b90fe216 Mon Sep 17 00:00:00 2001 From: bizrockman Date: Fri, 28 Feb 2025 22:04:39 +0100 Subject: [PATCH] fix: handle empty content correctly in FilesStore saveFile() (#1381) * Fix FilesStore: Handle empty content correctly in saveFile(). Happens when user creates files in the web terminal * updated logic --------- Co-authored-by: Anirban Kar --- app/lib/stores/files.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/stores/files.ts b/app/lib/stores/files.ts index 687b8037..60904a65 100644 --- a/app/lib/stores/files.ts +++ b/app/lib/stores/files.ts @@ -115,7 +115,7 @@ export class FilesStore { const oldContent = this.getFile(filePath)?.content; - if (!oldContent) { + if (!oldContent && oldContent !== '') { unreachable('Expected content to be defined'); }