From fee929fe415d0744d02ed05266394fe1df5f34b1 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Tue, 17 Nov 2020 21:54:01 +0100 Subject: [PATCH] Check for null in RfC question --- app/policies/request_for_comment_policy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/policies/request_for_comment_policy.rb b/app/policies/request_for_comment_policy.rb index 05033ffe..43d2e8de 100644 --- a/app/policies/request_for_comment_policy.rb +++ b/app/policies/request_for_comment_policy.rb @@ -8,7 +8,7 @@ class RequestForCommentPolicy < ApplicationPolicy end def show? - admin? || teacher_in_study_group? || author? || everyone && @record.question.exclude?('#loesung') + admin? || teacher_in_study_group? || author? || everyone && @record.question&.exclude?('#loesung') end def destroy?