Commit cb21c323 authored by Michał Zając's avatar Michał Zając

Return false when there are no findings

parent aef1c8d8
...@@ -74,6 +74,8 @@ class Vulnerability < ApplicationRecord ...@@ -74,6 +74,8 @@ class Vulnerability < ApplicationRecord
end end
def resolved_on_default_branch def resolved_on_default_branch
return false unless findings.any?
latest_successful_pipeline_for_default_branch = project.latest_successful_pipeline_for_default_branch latest_successful_pipeline_for_default_branch = project.latest_successful_pipeline_for_default_branch
latest_pipeline_with_vulnerability = finding.pipelines.order(created_at: :desc).first latest_pipeline_with_vulnerability = finding.pipelines.order(created_at: :desc).first
latest_pipeline_with_vulnerability != latest_successful_pipeline_for_default_branch latest_pipeline_with_vulnerability != latest_successful_pipeline_for_default_branch
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment