lib/hrw/formatter.rb in hrw-0.3.4 vs lib/hrw/formatter.rb in hrw-0.3.5
- old
+ new
@@ -49,10 +49,15 @@
puts
deps = filter(result)
deps.each do |dep|
dep['vulnerabilities'].each do |vuln|
- patched_version = JSON.parse(vuln['fixed_by'])
+ # TODO: bad smell here
+ begin
+ patched_version = JSON.parse(vuln['fixed_by'])
+ rescue JSON::ParserError
+ patched_version = vuln['fixed_by']
+ end
case vuln['severity']
when 'Defcon1', 'Critical', 'High'
color = :red
high += 1
\ No newline at end of file