From cbfc8d252dd5d847f2409dee5494560949d5bf1e Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 5 Apr 2024 16:09:19 -0400 Subject: [PATCH] fix: better handle null return from notes.assert --- src/activitypub/inbox.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js index 44be7cc293..1e7134c6de 100644 --- a/src/activitypub/inbox.js +++ b/src/activitypub/inbox.js @@ -36,8 +36,10 @@ inbox.create = async (req) => { throw new Error('[[error:activitypub.not-implemented]]'); } - const { tid, count } = await activitypub.notes.assert(0, object); - winston.verbose(`[activitypub/inbox] Parsing ${count} notes into topic ${tid}`); + const response = await activitypub.notes.assert(0, object); + if (response) { + winston.verbose(`[activitypub/inbox] Parsing ${response.count} notes into topic ${response.tid}`); + } }; inbox.update = async (req) => {