check if data.posts is valid

if data.posts was an empty array it was crashing, I  guess happens when all posts are deleted in a topic