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