[backend/federation] Don't fetch inboxUser from database if inboxUserId is null

This commit is contained in:
Laura Hausmann 2024-06-27 18:01:37 +02:00
parent e65c678a35
commit 0e6edb9046
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -57,7 +57,10 @@ public class ActivityHandlerService(
throw new Exception("resolvedActor.Host and resolvedActor.Uri must not be null at this stage");
UpdateInstanceMetadataInBackground(resolvedActor.Host, new Uri(resolvedActor.Uri).Host);
var inboxUser = await db.Users.IncludeCommonProperties().FirstOrDefaultAsync(p => p.Id == inboxUserId);
var inboxUser = inboxUserId != null
? await db.Users.IncludeCommonProperties().FirstOrDefaultAsync(p => p.Id == inboxUserId)
: null;
var task = activity switch
{