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); } /**