clans: fix game freezing when loading user profile

sending empty GetGroupsResult freezes the game
This commit is contained in:
Spirtix 2026-01-01 12:20:07 +01:00
parent 4f99f81373
commit aa9f106061

View File

@ -313,7 +313,7 @@ public class GroupController : Controller {
if (request.ForUserID != null) {
Viking? target = ctx.Vikings.FirstOrDefault(v => Guid.Parse(request.ForUserID) == v.Uid);
if (target == null) return Ok(new GetGroupsResult { Success = false });
if (target.GroupMembership?.Group == null) return Ok(new GetGroupsResult { Success = true });
if (target.GroupMembership?.Group == null) return Ok();
groupsQuery = groupsQuery.Where(g => g.GroupID == target.GroupMembership.Group.GroupID);
}