Skip to content
This repository has been archived by the owner on May 3, 2020. It is now read-only.

Commit

Permalink
corrects bug if finding is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
BuffaloWill committed Jul 21, 2017
1 parent f27fdb0 commit 238b819
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions views/findings_list.haml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
vulns = Hash.new 0
if @dread
@findings.each do |finding|
next unless finding
if finding.dread_total > 39
vulns["critical"] += 1
elsif finding.dread_total < 40 && finding.dread_total > 24
Expand All @@ -92,6 +93,7 @@
labels = {"label_1" => "Critical", "label_2" => "Severe", "label_3" => "Moderate", "label_4" => "Low" }
elsif @cvss
@findings.each do |finding|
next unless finding
if finding.cvss_total >= 7.0
vulns["severe"] += 1
elsif finding.cvss_total >= 4.0 and finding.cvss_total <= 6.9
Expand All @@ -103,6 +105,7 @@
labels = {"label_1" => "Critical (N/A)", "label_2" => "Severe", "label_3" => "Moderate", "label_4" => "Low"}
elsif @cvssv3
@findings.each do |finding|
next unless finding
if finding.cvss_total >= 9.0
vulns["critical"] += 1
elsif finding.cvss_total >= 7.0 and finding.cvss_total <= 8.9
Expand All @@ -116,6 +119,7 @@
labels = {"label_1" => "Critical", "label_2" => "Severe", "label_3" => "Moderate", "label_4" => "Low" }
else
@findings.each do |finding|
next unless finding
if finding.risk == 4
vulns["critical"] += 1
elsif finding.risk == 3
Expand Down

0 comments on commit 238b819

Please sign in to comment.