mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Return 0 if there is no topic associated with the post
This commit is contained in:
@ -19,7 +19,7 @@ class WebHookPostSerializer < PostSerializer
|
||||
end
|
||||
|
||||
def topic_posts_count
|
||||
object.topic && object.topic.posts_count
|
||||
object.topic ? object.topic.posts_count : 0
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user