From 362bcb787f523a0326353b0686755fe9de1c4fc6 Mon Sep 17 00:00:00 2001 From: Sven Merk Date: Mon, 11 Mar 2019 11:44:39 +0100 Subject: [PATCH] Cleanup --- vars/whitesourceExecuteScan.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/whitesourceExecuteScan.groovy b/vars/whitesourceExecuteScan.groovy index 6f89ae3f8..e52e281ff 100644 --- a/vars/whitesourceExecuteScan.groovy +++ b/vars/whitesourceExecuteScan.groovy @@ -359,10 +359,10 @@ void analyseWhitesourceResults(Map config, WhitesourceRepository repository, Whi if (!config.productToken) { def metaInfo = orgAdminRepository.fetchProductMetaInfo() def key = "token" - if(!metaInfo && config.createProductFromPipeline) { + if(null != metaInfo && !metaInfo[key] && config.createProductFromPipeline) { metaInfo = orgAdminRepository.createProduct() key = "productToken" - } else if(!metaInfo) { + } else if(null == metaInfo || !metaInfo[key]) { error "[WhiteSource] Could not fetch/find requested product '${config.productName}' and automatic creation has been disabled" } echo "Meta Info: ${metaInfo}"