Fix issue #232

Check if $post not 'null' to fix bunch of warning on post removal.