Skip to content

Commit

Permalink
unlink on null
Browse files Browse the repository at this point in the history
  • Loading branch information
tlgimenes committed Apr 5, 2024
1 parent bf3cfa8 commit 3000ef8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ export class Realtime implements DurableObject {
} else if (isTextFileSet(patch)) {
const { path, content } = patch;
try {
if (!content) {
await this.fs.writeFile(path, "");
if (content === null) {
await this.fs.unlink(path);
} else {
await this.fs.writeFile(path, content);
}
Expand Down

0 comments on commit 3000ef8

Please sign in to comment.