From 9b7db51436f1f85697e3c07281a70ef1e7752256 Mon Sep 17 00:00:00 2001 From: kim Date: Sun, 7 Sep 2025 18:16:43 +0200 Subject: [PATCH] [bugfix] check for nil notification (#4417) Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4417 Co-authored-by: kim Co-committed-by: kim --- internal/processing/timeline/notification.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/processing/timeline/notification.go b/internal/processing/timeline/notification.go index b17dda8a7..7b98970c2 100644 --- a/internal/processing/timeline/notification.go +++ b/internal/processing/timeline/notification.go @@ -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)