xcode_requirement: handle nil @version.

When the Xcode requirement doesn't specify a version then we need to
guard this check.
This commit is contained in:
Mike McQuaid 2018-02-09 19:37:15 +00:00
parent b4443e1cc0
commit c32865011d

View File

@ -22,7 +22,7 @@ class XcodeRequirement < Requirement
A full installation of Xcode.app#{version} is required to compile this software. A full installation of Xcode.app#{version} is required to compile this software.
Installing just the Command Line Tools is not sufficient. Installing just the Command Line Tools is not sufficient.
EOS EOS
if Version.new(MacOS::Xcode.latest_version) < Version.new(@version) if @version && Version.new(MacOS::Xcode.latest_version) < Version.new(@version)
message + <<~EOS message + <<~EOS
Xcode#{version} cannot be installed on macOS #{MacOS.version}. Xcode#{version} cannot be installed on macOS #{MacOS.version}.
You must upgrade your version of macOS. You must upgrade your version of macOS.