Fix another error that could occur when an actor doesn't have a public key

This commit is contained in:
Shadowfacts 2019-09-18 08:28:17 -04:00
parent bd24f4e480
commit b8346c7a19
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 1 deletions

View File

@ -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