Commit 27502ad3 authored by Cédric OLIVIER's avatar Cédric OLIVIER Committed by Pierre Smeyers
Browse files

fix: error handling in case the product is not found

parent 6cc3bb51
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ variables:
    # search DefectDojo product (=project)
    curl -L "${DEFECTDOJO_SERVER_URL}/api/v2/products/?name=$CI_PROJECT_PATH" --header "Content-Type: application/json" --header "Authorization: Token $DEFECTDOJO_API_KEY" 1> api_search_product.json
    dd_product_pk=$(jq ".results[0].id" api_search_product.json)
    if [[ -z "${dd_product_pk}" ]]; then
    if [[ "${dd_product_pk}" == "null" ]]; then
      log_error "product not found (check API key)"
      exit 1
    fi