1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-30 05:59:39 +02:00

Avoid NPEs when not having JOB_URL, BUILD_URL (#1836)

When running inside a jenkins file runner scenario these parameters might
not be available.
This commit is contained in:
Marcus Holl 2020-07-27 09:29:22 +02:00 committed by GitHub
parent 7f4fab762d
commit 5589abbd0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,8 +113,8 @@ void pushToSWA(Map parameters, Map config) {
try {
parameters.actionName = parameters.get('actionName') ?: 'Piper Library OS'
parameters.eventType = parameters.get('eventType') ?: 'library-os'
parameters.jobUrlSha1 = generateSha1(env.JOB_URL)
parameters.buildUrlSha1 = generateSha1(env.BUILD_URL)
parameters.jobUrlSha1 = generateSha1(env.JOB_URL ?: '')
parameters.buildUrlSha1 = generateSha1(env.BUILD_URL ?: '')
Telemetry.notify(this, config, parameters)
} catch (ignore) {