diff options
| author | Andrew Janke | 2016-05-04 15:54:01 -0400 |
|---|---|---|
| committer | Andrew Janke | 2016-05-04 15:54:01 -0400 |
| commit | 6f80b4688bce7b391093412def6e65c3b61cbd20 (patch) | |
| tree | 107c99d3c80d07ca4e1de78ad191314b4e530655 /Library | |
| parent | 9a9a989b75288f65cbede3777e2a57e636243c19 (diff) | |
| download | brew-6f80b4688bce7b391093412def6e65c3b61cbd20.tar.bz2 | |
doctor: guard against nil Xcode.version (#197)
MacOS::Xcode.version may be nil (when neither Xcode nor CLT are installed),
so guard against that where it may happen in `brew doctor`.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index d79e540c1..086a68f91 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -416,7 +416,7 @@ module Homebrew end def check_for_osx_gcc_installer - return unless MacOS.version < "10.7" || MacOS::Xcode.version > "4.1" + return unless MacOS.version < "10.7" || ((MacOS::Xcode.version || "0") > "4.1") return unless MacOS.clang_version == "2.1" fix_advice = if MacOS.version >= :mavericks @@ -439,7 +439,7 @@ module Homebrew # if the uninstaller script isn't there, it's a good guess neither are # any troublesome leftover Xcode files uninstaller = Pathname.new("/Developer/Library/uninstall-developer-folder") - return unless MacOS::Xcode.version >= "4.3" && uninstaller.exist? + return unless ((MacOS::Xcode.version || "0") >= "4.3") && uninstaller.exist? <<-EOS.undent You have leftover files from an older version of Xcode. |
