fix count of poll voters
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Tue, 8 Nov 2022 13:50:04 +0000 (13:50 +0000)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Tue, 8 Nov 2022 13:50:04 +0000 (13:50 +0000)
lib/pleroma/web/mastodon_api/views/poll_view.ex

index 71bc8b949229f3f0bd8c3f6a66a7af8b9c613b21..aa6443754f1b31ac440159b2aae02fd6a2d2fe70 100644 (file)
@@ -68,7 +68,7 @@ defmodule Pleroma.Web.MastodonAPI.PollView do
     end)
   end
 
-  defp voters_count(%{data: %{"voters" => [_ | _] = voters}}) do
+  defp voters_count(%{data: %{"voters" => voters}}) when is_list(voters) do
     length(voters)
   end