Check for empty post object

Avoid notices by checking for an empty post object.

Fixes #10