From 4f484196d01ddbf56255e786bf3b728f98478e76 Mon Sep 17 00:00:00 2001 From: Francisco Javier Fernandez Gonzalez Date: Mon, 27 Nov 2017 09:17:40 +0100 Subject: [PATCH] [JENKINS-48232] fix findbugs and NullpointerException --- .../jenkins/plugins/sshcredentials/SSHAuthenticator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/SSHAuthenticator.java b/src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/SSHAuthenticator.java index 754d6ac..47f0c72 100644 --- a/src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/SSHAuthenticator.java +++ b/src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/SSHAuthenticator.java @@ -232,7 +232,7 @@ public static SSHAuthenticator */ private static List lookupFactories() { // TODO once Jenkins core has a class that can be used to detect running on build agent use that to gate instead - return Jenkins.getInstance() == null ? null : ExtensionList.lookup(SSHAuthenticatorFactory.class); + return Jenkins.getInstanceOrNull() == null ? null : ExtensionList.lookup(SSHAuthenticatorFactory.class); } /**