From f4ba6ee9156ebfbab7878a9eabe63b95603b221a Mon Sep 17 00:00:00 2001 From: Dzmitry Nichyparenka Date: Fri, 24 Dec 2021 12:34:47 +0300 Subject: [PATCH] Fix NPE when the "isProxy" method returns null --- src/main/java/com/checkmarx/jenkins/CxScanBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/checkmarx/jenkins/CxScanBuilder.java b/src/main/java/com/checkmarx/jenkins/CxScanBuilder.java index 92ad8a8e..036ac554 100644 --- a/src/main/java/com/checkmarx/jenkins/CxScanBuilder.java +++ b/src/main/java/com/checkmarx/jenkins/CxScanBuilder.java @@ -1305,7 +1305,7 @@ private CxScanConfig resolveConfiguration(Run run, DescriptorImpl descript ret.setUrl(cxConnectionDetails.getServerUrl().trim()); ret.setUsername(cxConnectionDetails.getUsername()); ret.setPassword(Aes.decrypt(cxConnectionDetails.getPassword(), cxConnectionDetails.getUsername())); - if (cxConnectionDetails.isProxy()) { + if (cxConnectionDetails.isProxy() != null && cxConnectionDetails.isProxy()) { Jenkins instance = Jenkins.getInstance(); if (instance != null && instance.proxy != null && !(isCxURLinNoProxyHost(useOwnServerCredentials ? this.serverUrl : getDescriptor().getServerUrl(), instance.proxy.getNoProxyHostPatterns()))) {