From b8346c7a193d7f35fbaf7e278c3d976b1b64d6eb Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 18 Sep 2019 08:28:17 -0400 Subject: [PATCH] Fix another error that could occur when an actor doesn't have a public key --- lib/activitypub/middleware/http-signature.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/activitypub/middleware/http-signature.ts b/lib/activitypub/middleware/http-signature.ts index 4d3e827..4f583b8 100644 --- a/lib/activitypub/middleware/http-signature.ts +++ b/lib/activitypub/middleware/http-signature.ts @@ -8,7 +8,7 @@ export = async (req: Request, res: Response, next: NextFunction) => { return; } const actor = await getActor(req.body.actor as string); - if (actor && validate(req, actor.publicKey.publicKeyPem)) { + if (actor && actor.publicKey && validate(req, actor.publicKey.publicKeyPem)) { next(); } else { // if the first check fails, force re-fetch the actor and try again