Skip to content

Commit

Permalink
Reader#read_directories: guard against an entry not being a directory (
Browse files Browse the repository at this point in the history
…#6226)

Merge pull request 6226
  • Loading branch information
parkr authored and jekyllbot committed Jul 25, 2017
1 parent 897cdbb commit 188bc71
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/jekyll/reader.rb
Expand Up @@ -39,6 +39,8 @@ def sort_files!
def read_directories(dir = "")
base = site.in_source_dir(dir)

return unless File.directory?(base)

dot = Dir.chdir(base) { filter_entries(Dir.entries("."), base) }
dot_dirs = dot.select { |file| File.directory?(@site.in_source_dir(base, file)) }
dot_files = (dot - dot_dirs)
Expand Down

0 comments on commit 188bc71

Please sign in to comment.