[backend/core] Fix polls originating from masto-api

This commit is contained in:
Laura Hausmann 2024-05-06 23:40:47 +02:00
parent 32a4875162
commit fe7d85fa91
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -209,7 +209,7 @@ public class NoteService(
poll.UserHost = note.UserHost;
poll.NoteVisibility = note.Visibility;
if (poll.Votes.Count != poll.Choices.Count)
if (poll.Votes == null! || poll.Votes.Count != poll.Choices.Count)
poll.Votes = poll.Choices.Select(_ => 0).ToList();
await db.AddAsync(poll);