Skip to content

Commit

Permalink
Fixed an NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
felfert committed Feb 6, 2015
1 parent c6ca88f commit 19b048d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public NodeMetadata get() {
.authorizeAdminPublicKey(true).adminPublicKey(getCloud().publicKey).adminHome(getFsRoot()).build();

// Jenkins needs /jenkins dir.
Statement jenkinsDirStatement = Statements.newStatementList(Statements.exec("mkdir -p " + getFsRoot()),
Statement jenkinsDirStatement = newStatementList(Statements.exec("mkdir -p " + getFsRoot()),
Statements.exec("chown " + getJenkinsUser() + " " + getFsRoot()));

initStatement = newStatementList(adminAccess, jenkinsDirStatement, Statements.exec(this.initScript));
Expand All @@ -310,7 +310,11 @@ public NodeMetadata get() {
if (preInstalledJava) {
bootstrap = initStatement;
} else {
bootstrap = newStatementList(initStatement, InstallJDK.fromOpenJDK());
if (null == initStatement) {
bootstrap = newStatementList(InstallJDK.fromOpenJDK());
} else {
bootstrap = newStatementList(initStatement, InstallJDK.fromOpenJDK());
}
}

options.inboundPorts(22).userMetadata(userMetadata);
Expand Down

0 comments on commit 19b048d

Please sign in to comment.