A platform for community discussion. Free, open, simple.
Fix NoMethodError in polls#voters
Penar Musaraj753d39f30ddf
diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rbindex 44f818cabd5..1f8dc37da37 100644--- a/plugins/poll/plugin.rb+++ b/plugins/poll/plugin.rb@@ -245,6 +245,7 @@ after_initialize dopost = Post.find_by(id: post_id)raise Discourse::InvalidParameters.new("post_id is invalid") if !post+ raise Discourse::InvalidParameters.new("no poll exists for this post_id") unless post.custom_fields[DiscoursePoll::POLLS_CUSTOM_FIELD]poll = post.custom_fields[DiscoursePoll::POLLS_CUSTOM_FIELD][poll_name]raise Discourse::InvalidParameters.new("poll_name is invalid") if !poll