Skip to content

Commit

Permalink
OTWO-7303 Fixed BDSA page for missing score data (#1798)
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya5 authored Sep 12, 2024
1 parent 2a41d5b commit fbf4a95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/helpers/api/vulnerabilities_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def bdsa_cve_id(data)
end

def cvss3_severity(data, type = nil)
score = type == 'CVE' ? data['baseScore'] : data['temporalMetrics']['score']
"#{score} #{data['severity'].titleize}"
score = type == 'CVE' ? data['baseScore'] : data['temporalMetrics'].try { |metrics| metrics['score'] }
"#{score} #{data['severity'].titleize}" if score
end

def bdsa_cvss(cvss_data)
Expand Down
2 changes: 1 addition & 1 deletion app/views/api/vulnerabilities/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
.col-lg-3.col-xs-6.summary-info
.row.overflow-hidden
.col-lg-8.col-xs-10
%span= cvss3_severity(@response['cvss3'])
%span= cvss3_severity(@response['cvss3']) || 'Temporal score not available'
%br
%span BDSA
.col-lg-4.col-xs-2
Expand Down

0 comments on commit fbf4a95

Please sign in to comment.