mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 18:58:10 +00:00
Return 0 if there is no topic associated with the post
This commit is contained in:
parent
22ca5a772d
commit
841a988454
@ -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…
x
Reference in New Issue
Block a user