mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 11:12:25 -05:00
[bugfix] check for nil notification (#4417)
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4417 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
4b6c65fc15
commit
9b7db51436
1 changed files with 8 additions and 0 deletions
|
|
@ -166,6 +166,14 @@ func (p *Processor) NotificationGet(ctx context.Context, account *gtsmodel.Accou
|
|||
return nil, gtserror.NewErrorInternalError(err)
|
||||
}
|
||||
|
||||
if notif == nil {
|
||||
const text = "notification not found"
|
||||
return nil, gtserror.NewErrorNotFound(
|
||||
errors.New(text),
|
||||
text,
|
||||
)
|
||||
}
|
||||
|
||||
if notif.TargetAccountID != account.ID {
|
||||
err := gtserror.New("requester does not match notification target")
|
||||
return nil, gtserror.NewErrorNotFound(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue