[backend/masto-client] Fix notifications endpoints when notification has no notifier (because the user was deleted, etc)

This commit is contained in:
Laura Hausmann 2024-03-07 04:20:01 +01:00
parent 6d06afd5cb
commit 7d4d2e831e
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -36,6 +36,7 @@ public class NotificationController(DatabaseContext db, NotificationRenderer not
var res = await db.Notifications var res = await db.Notifications
.IncludeCommonProperties() .IncludeCommonProperties()
.Where(p => p.Notifiee == user) .Where(p => p.Notifiee == user)
.Where(p => p.Notifier != null)
.Where(p => p.Type == NotificationType.Follow || .Where(p => p.Type == NotificationType.Follow ||
p.Type == NotificationType.Mention || p.Type == NotificationType.Mention ||
p.Type == NotificationType.Reply || p.Type == NotificationType.Reply ||