diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb index 85c9f5632cf..44f818cabd5 100644 --- a/plugins/poll/plugin.rb +++ b/plugins/poll/plugin.rb @@ -281,7 +281,7 @@ after_initialize do user_hash = UserNameSerializer.new(user).serializable_hash # protect against poorly denormalized data - poll_votes.dig(user.id.to_s, poll_name)&.each do |option_id| + poll_votes&.dig(user.id.to_s, poll_name)&.each do |option_id| if (params[:option_id]) next unless option_id == params[:option_id].to_s end