Skip to content

A platform for community discussion. Free, open, simple.

FIX: if poll has not options do not break serializer

Sam29fdb503387c
diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb
index 1f8dc37da37..21b586f98b2 100644
--- a/plugins/poll/plugin.rb
+++ b/plugins/poll/plugin.rb
@@ -414,6 +414,7 @@ after_initialize do
polls = post_custom_fields[DiscoursePoll::POLLS_CUSTOM_FIELD].dup
polls.each do |_, poll|
+ next if !poll
poll["options"].each do |option|
option.delete("voter_ids")
end