mirror of
https://github.com/discourse/discourse.git
synced 2025-09-04 08:47:37 +08:00
Return 0 if there is no topic associated with the post
This commit is contained in:
parent
22ca5a772d
commit
841a988454
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue