From 1baffe9c920757eb59b839ad363fff0141e7828e Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 19 Sep 2023 15:15:53 +0200 Subject: [PATCH] fix: allow the activitypub Person request to fail --- src/serviceProviders/activitypub.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/serviceProviders/activitypub.js b/src/serviceProviders/activitypub.js index e2d9023..68362cd 100644 --- a/src/serviceProviders/activitypub.js +++ b/src/serviceProviders/activitypub.js @@ -81,8 +81,12 @@ export const functions = { switch (proofData.result.type) { case 'Note': { claimData.profile.uri = proofData.result.attributedTo + claimData.profile.display = proofData.result.attributedTo const personData = await fetcher.activitypub.fn({ url: proofData.result.attributedTo }, opts) - claimData.profile.display = `@${personData.preferredUsername}@${new URL(claimData.proof.request.uri).hostname}` + .catch(_ => null) + if (personData) { + claimData.profile.display = `@${personData.preferredUsername}@${new URL(claimData.proof.request.uri).hostname}` + } break }