BUGFIX: ensure topic_view exists before attempting to access it

This commit is contained in:
Sam 2014-02-11 10:23:47 +11:00
parent 8a4b603bfd
commit 750d3a6b18

View File

@ -77,7 +77,7 @@ class PostSerializer < BasicPostSerializer
end
def primary_group_name
return nil unless object.user
return nil unless object.user && @topic_view
return @topic_view.primary_group_names[object.user.primary_group_id] if object.user.primary_group_id
end