diff --git a/Iceshrimp.Backend/Core/Services/NoteService.cs b/Iceshrimp.Backend/Core/Services/NoteService.cs index 291e7eda..57bfa133 100644 --- a/Iceshrimp.Backend/Core/Services/NoteService.cs +++ b/Iceshrimp.Backend/Core/Services/NoteService.cs @@ -623,12 +623,20 @@ public class NoteService( note.Poll.Votes = poll.Votes == null! || poll.Votes.Count != poll.Choices.Count ? poll.Choices.Select(_ => 0).ToList() : poll.Votes; - note.Poll.VotersCount = poll.VotersCount ?? note.Poll.VotersCount; + note.Poll.VotersCount = + poll.VotersCount ?? + (note.Poll.VotersCount == null + ? null + : Math.Max(note.Poll.VotersCount.Value, note.Poll.Votes.Sum())); } else if (poll.Votes.Count == poll.Choices.Count) { - note.Poll.Votes = poll.Votes; - note.Poll.VotersCount = poll.VotersCount ?? note.Poll.VotersCount; + note.Poll.Votes = poll.Votes; + note.Poll.VotersCount = + poll.VotersCount ?? + (note.Poll.VotersCount == null + ? null + : Math.Max(note.Poll.VotersCount.Value, note.Poll.Votes.Sum())); } } else