From 0d731813dfd7ba97137c3f8eb90458be3c39985d Mon Sep 17 00:00:00 2001 From: toke Date: Wed, 28 Jun 2023 23:08:42 +0200 Subject: [PATCH] fix: paste creation didn't work if not logged in --- src/routes/paste.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/paste.ts b/src/routes/paste.ts index 7378c37..35581c0 100644 --- a/src/routes/paste.ts +++ b/src/routes/paste.ts @@ -40,7 +40,7 @@ class Pastes extends Routes { const authorIdentity = await this.requireAuthentication(req) const size = Buffer.byteLength(content, "utf8") - const maxSize = getMaxSize(authorIdentity.user) + const maxSize = getMaxSize(authorIdentity?.user) if (size > maxSize) return this.sendErrorResponse(res, 413, pasteErrors.tooBig) if (title.length > 300) return this.sendErrorResponse(res, 413, pasteErrors.invalidName)