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)