From d6dd7535f45456d33acee21ffb140bb53e04472f Mon Sep 17 00:00:00 2001 From: stringsplit <77242831+nbitzz@users.noreply.github.com> Date: Sat, 9 Mar 2024 14:34:00 -0800 Subject: [PATCH] Quick fix --- package.json | 2 +- src/server/lib/files.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3395db6..b65f36d 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "author": "Etcetera (https://cetera.uk)", "license": "Unlicense", "engines": { - "node": ">=v20" + "node": ">=v21" }, "dependencies": { "@hono/node-server": "^1.8.2", diff --git a/src/server/lib/files.ts b/src/server/lib/files.ts index 9cf3f0a..09b8aef 100644 --- a/src/server/lib/files.ts +++ b/src/server/lib/files.ts @@ -435,7 +435,7 @@ export class UploadStream extends Writable { } delete this.files.locks[this.uploadId!] - await this.files.api.deleteMessages(ogf.messageids) + if (ogf?.messageids) await this.files.api.deleteMessages(ogf.messageids) await this.files.write() if (this.owner) Accounts.files.index(this.owner, this.uploadId!) return this.uploadId