diff --git a/app/helpers/api/vulnerabilities_helper.rb b/app/helpers/api/vulnerabilities_helper.rb index 9c4799a9a..0be072966 100644 --- a/app/helpers/api/vulnerabilities_helper.rb +++ b/app/helpers/api/vulnerabilities_helper.rb @@ -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) diff --git a/app/views/api/vulnerabilities/show.html.haml b/app/views/api/vulnerabilities/show.html.haml index a8e8f9029..5a98f6fc7 100644 --- a/app/views/api/vulnerabilities/show.html.haml +++ b/app/views/api/vulnerabilities/show.html.haml @@ -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