Skip to content

Commit

Permalink
Null safety.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Jun 10, 2014
1 parent 68f113a commit a8fe158
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -114,9 +114,8 @@ public void checkout(Run<?, ?> build, Launcher launcher,
logWriter.write(String.format("<%s>\n", MultiSCMChangeLogParser.ROOT_XML_TAG));

for(SCM scm : scms) {
String changeLogPath = changelogFile.getPath() + ".temp";
File subChangeLog = new File(changeLogPath);
scm.checkout(build, launcher, workspace, listener, subChangeLog, oldBaseline.get(scm, workspace, build instanceof AbstractBuild ? (AbstractBuild) build : null));
File subChangeLog = changelogFile != null ? new File(changelogFile.getPath() + ".temp") : null;
scm.checkout(build, launcher, workspace, listener, subChangeLog, oldBaseline != null ? oldBaseline.get(scm, workspace, build instanceof AbstractBuild ? (AbstractBuild) build : null) : null);

List<Action> actions = build.getActions();
for(Action a : actions) {
Expand All @@ -125,7 +124,7 @@ public void checkout(Run<?, ?> build, Launcher launcher,
revisionState.add(scm, workspace, build, (SCMRevisionState) a);
}
}
if (subChangeLog.exists()) {
if (subChangeLog != null && subChangeLog.exists()) {
String subLogText = FileUtils.readFileToString(subChangeLog);
//Dont forget to escape the XML in case there is any CDATA sections
logWriter.write(String.format("<%s scm=\"%s\">\n<![CDATA[%s]]>\n</%s>\n",
Expand Down

0 comments on commit a8fe158

Please sign in to comment.