Skip to content

Commit

Permalink
Merge pull request #6304 from jekyll/3.5-stable-backport-6226
Browse files Browse the repository at this point in the history
Backport #6226 for v3.5.x: Reader#read_directories: guard against an entry not being a directory
  • Loading branch information
parkr committed Aug 12, 2017
2 parents ae46887 + 904eeee commit 867fc40
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 867fc40

Please sign in to comment.