diff options
| author | Jack Nagel | 2012-07-04 23:15:45 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-07-04 23:15:45 -0500 |
| commit | bac9b5e05f803119b8a54fe7db74d3ecaac626c2 (patch) | |
| tree | a3c23a19b32b3ffb1c59114d3f56be76c2508cd9 /Library | |
| parent | 3ec7beb699ef3b5d518f5b2fb90ed2a5a6af08b1 (diff) | |
| download | homebrew-bac9b5e05f803119b8a54fe7db74d3ecaac626c2.tar.bz2 | |
bottles: protect against a nil bottle
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/bottles.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb index d2abbf03f..12679e229 100644 --- a/Library/Homebrew/bottles.rb +++ b/Library/Homebrew/bottles.rb @@ -22,17 +22,17 @@ def built_bottle? f end def bottle_current? f - f.bottle.url && !f.bottle.checksum.empty? && f.bottle.version == f.stable.version + f.bottle and f.bottle.url && !f.bottle.checksum.empty? && f.bottle.version == f.stable.version end def bottle_file_outdated? f, file filename = file.basename.to_s - return nil unless (filename.match(bottle_regex) or filename.match(old_bottle_regex)) and f.bottle_url + return nil unless (filename.match(bottle_regex) or filename.match(old_bottle_regex)) and f.bottle and f.bottle.url bottle_ext = filename.match(bottle_native_regex).captures.first rescue nil bottle_ext ||= filename.match(old_bottle_regex).captures.first rescue nil - bottle_url_ext = f.bottle_url.match(bottle_native_regex).captures.first rescue nil - bottle_url_ext ||= f.bottle_url.match(old_bottle_regex).captures.first rescue nil + bottle_url_ext = f.bottle.url.match(bottle_native_regex).captures.first rescue nil + bottle_url_ext ||= f.bottle.url.match(old_bottle_regex).captures.first rescue nil bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext end |
