Skip to content

Commit

Permalink
fix: paste creation didn't work if not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
romeq committed Jun 28, 2023
1 parent 9607ac1 commit 0d73181
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/paste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0d73181

Please sign in to comment.