Prevent errors when asking anonymous questions
This commit is contained in:
parent
677480902d
commit
14e84fd47c
|
@ -7,7 +7,7 @@ class Inbox < ApplicationRecord
|
|||
end
|
||||
|
||||
def answer(answer_content, user)
|
||||
raise Errors::AnsweringOtherBlockedSelf if question.user.blocking?(user)
|
||||
raise Errors::AnsweringOtherBlockedSelf if question.user&.blocking?(user)
|
||||
raise Errors::AnsweringSelfBlockedOther if user.blocking?(question.user)
|
||||
|
||||
answer = user.answer(self.question, answer_content)
|
||||
|
|
Loading…
Reference in New Issue