check if data.posts is valid
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
yariplus/nodebb-plugin-poll,Schamper/nodebb-plugin-poll