Closed kwkwan closed 6 years ago
When there are no duplicate certificates, the following calls will error out.
order.duplicate_certificates # or Digicert::DuplicateCertificateFinder.find_by(request_id: request_id)
Will lead to this error:
===============[API Reqeust Begin]================ [URI] GET https://www.digicert.com/services/v2/order/certificate/order_id/duplicate [Headers] {"content-type"=>["application/json"], "x-dc-devkey"=>["xxxxxxxxx"], "host"=>["www.digicert.com"]} [Response] #<Net::HTTPOK 200 OK readbody=true> [Response Body] {} ================[API Reqeust End]================= NoMethodError: private method `select' called for nil:NilClass from /Users/user/src/digicert/lib/digicert/duplicate_certificate_finder.rb:24:in `certificates_by_date_created'
It would be more appropriate to return an empty array.
Thanks for reporting this @kwkwan, you are right, I just updated the finder so if there is no duplicate certificate then it won't raise an error but return nil instead, thanks!
When there are no duplicate certificates, the following calls will error out.
Will lead to this error:
It would be more appropriate to return an empty array.