mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-13 21:33:20 +01:00
Prevent errors when asking anonymous questions
This commit is contained in:
parent
677480902d
commit
14e84fd47c
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue