mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 04:07:27 +00:00
Fix NoMethodError in polls#voters
This commit is contained in:
parent
a0be127b6f
commit
753d39f30d
@ -245,6 +245,7 @@ after_initialize do
|
||||
|
||||
post = 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user