From 6f0a3e0c0a21e8e9ebad63d79d93fe1aa3b86d28 Mon Sep 17 00:00:00 2001 From: Sven Merk <33895725+nevskrem@users.noreply.github.com> Date: Wed, 11 Dec 2019 13:34:01 +0100 Subject: [PATCH] Fix NPE in case no version specified in descriptor --- vars/whitesourceExecuteScan.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/whitesourceExecuteScan.groovy b/vars/whitesourceExecuteScan.groovy index c54b63566..6930bbca4 100644 --- a/vars/whitesourceExecuteScan.groovy +++ b/vars/whitesourceExecuteScan.groovy @@ -468,7 +468,7 @@ private resolveProjectIdentifiers(script, descriptorUtils, config) { config.whitesource.projectName = "${gav.group?:''}${gav.group?'.':''}${gav.artifact}" def versionFragments = gav.version?.tokenize('.') - def version = versionFragments.size() > 0 ? versionFragments.head() : null + def version = versionFragments?.size() > 0 ? versionFragments?.head() : null if(version && !config.whitesource.productVersion) config.whitesource.productVersion = version }