mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:23:25 +08:00
FIX: prevents exception if thread is not found (#21099)
It is yet to investigate the exact reasons leading to this, but probably due to some delete operation or migration, it seems possible to have a message with a thread_id leading to a non existing thread row. This is only a temporary solution to prevent the crash. We should also probably be more defensive here and not include any of this if threading is not enabled.
This commit is contained in:
parent
d6b6041ae2
commit
ba11cf4767
|
@ -158,7 +158,7 @@ module Chat
|
|||
end
|
||||
|
||||
def thread_reply_count
|
||||
object.thread.replies_count
|
||||
object.thread&.replies_count || 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user