From 612da7c3b087d31b9ffc0c0975431f89d9056ca8 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 24 Sep 2014 17:40:17 -0500 Subject: Make sure the directory exists before chdir --- Library/Homebrew/cmd/doctor.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Library') diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index fddbf31fb..374b66c2e 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -104,6 +104,8 @@ def check_for_macgpg2 end def __check_stray_files(dir, pattern, white_list, message) + return unless Dir.exist?(dir) + files = Dir.chdir(dir) { Dir[pattern].select { |f| File.file?(f) && !File.symlink?(f) } } -- cgit v1.2.3