Skip to content

Commit

Permalink
Prevent NPE if Windows agent private key credential ID is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Smith committed Feb 25, 2021
1 parent 9efad89 commit 42a0fe3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static boolean authenticateSSH(
TaskListener listener)
throws Exception {
boolean isAuthenticated;
if (!windowsConfig.getPrivateKeyCredentialsId().isEmpty()) {
if (windowsConfig.getPrivateKeyCredentialsId() && !windowsConfig.getPrivateKeyCredentialsId().isEmpty()) {
isAuthenticated =
SSHAuthenticator.newInstance(
sshConnection, windowsConfig.getPrivateKeyCredentials(), windowsUsername)
Expand Down

0 comments on commit 42a0fe3

Please sign in to comment.