audit: check that there are any stable revisions.

Fixes the exception if `revision_map[formula.stable.version]` is `nil`.
This commit is contained in:
Mike McQuaid 2016-11-16 08:59:51 +00:00
parent 34f08a9512
commit 27ea94adb8

View File

@ -700,7 +700,8 @@ class FormulaAuditor
return if formula.revision.zero?
if formula.stable
revision_map = attributes_map[:revision][:stable]
if revision_map[formula.stable.version].empty? # check stable spec
stable_revisions = revision_map[formula.stable.version]
if !stable_revisions || stable_revisions.empty?
problem "'revision #{formula.revision}' should be removed"
end
else # head/devel-only formula