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 2bf77a4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public static boolean authenticateSSH(
TaskListener listener)
throws Exception {
boolean isAuthenticated;
if (!windowsConfig.getPrivateKeyCredentialsId().isEmpty()) {
if (windowsConfig.getPrivateKeyCredentialsId() != null
&& !windowsConfig.getPrivateKeyCredentialsId().isEmpty()) {
isAuthenticated =
SSHAuthenticator.newInstance(
sshConnection, windowsConfig.getPrivateKeyCredentials(), windowsUsername)
Expand Down

0 comments on commit 2bf77a4

Please sign in to comment.