Check file type before accessing its extension (#590)
Check file type before accessing its extension (#590)

Since directories do not have `extname`, when switched to index listing, `FilePreview` was throwing an error saying `file.extname` is undefined.
Fixed it by checking file type before accessing `extname`.
jekyll/jekyll-admin,jekyll/jekyll-admin,jekyll/jekyll-admin,jekyll/jekyll-admin