Skip to content

A platform for community discussion. Free, open, simple.

Return 0 if there is no topic associated with the post

scossar841a988454fa
diff --git a/app/serializers/web_hook_post_serializer.rb b/app/serializers/web_hook_post_serializer.rb
index 623e8ab9df6..31e214cecc7 100644
--- a/app/serializers/web_hook_post_serializer.rb
+++ b/app/serializers/web_hook_post_serializer.rb
@@ -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