add null check for stat

when using the tags plugin, this line throws sometimes an uncaught exception because `stat` is null
fix https://github.com/docpad/docpad-plugin-tags/issues/3