FIX: if poll has not options do not break serializer

Note: we have a proper rewrite of this plugin in progress
it will address this issue in a proper way
This commit is contained in:
Sam 2018-10-24 10:04:17 +11:00
parent 64aca0dc1b
commit 29fdb50338
1 changed files with 1 additions and 0 deletions

View File

@ -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