Check for null in RfC question

This commit is contained in:
Sebastian Serth
2020-11-17 21:54:01 +01:00
parent 9fcb178839
commit fee929fe41

View File

@ -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?