fix(FileStorage): add check for existing directory before deletion

This commit is contained in:
eeee0717
2025-03-26 09:51:58 +08:00
parent 52838f93e3
commit 721a255a22
+3
View File
@@ -216,6 +216,9 @@ class FileStorage {
}
public deleteDir = async (_: Electron.IpcMainInvokeEvent, id: string): Promise<void> => {
if (!fs.existsSync(path.join(this.storageDir, id))) {
return
}
await fs.promises.rm(path.join(this.storageDir, id), { recursive: true })
}