mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:37:02 +08:00
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:
@ -414,6 +414,7 @@ after_initialize do
|
|||||||
polls = post_custom_fields[DiscoursePoll::POLLS_CUSTOM_FIELD].dup
|
polls = post_custom_fields[DiscoursePoll::POLLS_CUSTOM_FIELD].dup
|
||||||
|
|
||||||
polls.each do |_, poll|
|
polls.each do |_, poll|
|
||||||
|
next if !poll
|
||||||
poll["options"].each do |option|
|
poll["options"].each do |option|
|
||||||
option.delete("voter_ids")
|
option.delete("voter_ids")
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user