From e61144beb8ba9ddf0d4a5144996311fcb18a1c3b Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 18 Dec 2024 13:45:53 -0500 Subject: [PATCH] Mark as owner if stub doesn't exist Old Google Drive files without a stub have no author, so if no stub exists, consider the current user the owner. --- server/homebrew.api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 7bf10f38d..56da8872c 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -106,7 +106,7 @@ const api = { stub = stub?.toObject(); googleId ??= stub?.googleId; - const isOwner = stub?.authors?.length === 0 || stub?.authors?.[0] === req.account?.username; + const isOwner = !stub || stub?.authors?.length === 0 || stub?.authors?.[0] === req.account?.username; const isAuthor = stub?.authors?.includes(req.account?.username); const isInvited = stub?.invitedAuthors?.includes(req.account?.username);