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
uh apparently data.posts[0] can be undefined/null as well
Merge pull request #4 from barisusakli/patch-1

check if data.posts is valid