bin/pwn_bdba_scan in pwn-0.4.927 vs bin/pwn_bdba_scan in pwn-0.4.928
- old
+ new
@@ -132,20 +132,25 @@
sleep 1
end
scan_progress_busy_duration += 10
end
- product_id = scan_progress_resp[:products].find { |p| p[:name] == CGI.escape(File.basename(target_file)) }[:product_id]
+ find_product = scan_progress_resp[:products].find { |p| p[:name] == CGI.escape(File.basename(target_file)) }
+ raise NoMethodError if find_product.nil?
+
+ product_id = find_product[:product_id]
+
scan_report_resp = PWN::Plugins::BlackDuckBinaryAnalysis.generate_product_report(
token: token,
product_id: product_id,
type: report_type,
output_path: report_path
)
puts "\nReport Saved to: #{report_path}"
rescue IO::TimeoutError,
+ NoMethodError,
RestClient::BadGateway,
RestClient::BadRequest,
RestClient::Exceptions::OpenTimeout,
RestClient::Forbidden,
RestClient::GatewayTimeout,