From a71fe16647c69db57aa47a40f94a3eb82176b79b Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 20 Aug 2018 10:37:06 +1000 Subject: [PATCH] workaround, we need another lazy operator here Data can be pretty inconsistent here till our big refactor is done --- plugins/poll/plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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