mirror of
1
Fork 0

[bugfix] Populate followReq before accessing targetaccount pointer (#2099)

This commit is contained in:
tobi 2023-08-11 11:05:49 +02:00 committed by GitHub
parent 5588d4e88e
commit a26af1310f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -265,6 +265,10 @@ func (p *fediAPI) CreateFollowReq(ctx context.Context, fMsg messages.FromFediAPI
return gtserror.Newf("%T not parseable as *gtsmodel.FollowRequest", fMsg.GTSModel)
}
if err := p.state.DB.PopulateFollowRequest(ctx, followRequest); err != nil {
return gtserror.Newf("error populating follow request: %w", err)
}
if *followRequest.TargetAccount.Locked {
// Account on our instance is locked:
// just notify the follow request.