diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index d321f1c259..6075f0cd24 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -94,4 +94,4 @@ unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT'] require 'compatibility' end -ORIGINAL_PATHS = ENV['PATH'].split(':').map{ |p| Pathname.new(File.expand_path(p)) } +ORIGINAL_PATHS = ENV['PATH'].split(':').map{ |p| Pathname.new(File.expand_path(p)) rescue nil }.compact.freeze