Skip to content

Commit

Permalink
PLANNER-1540 Avoid NPE when opponentTeam has not been initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
rsynek authored and ge0ffrey committed Jun 27, 2019
1 parent e57db58 commit 6e854ca
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ public void writeSolution() throws IOException {
}
}
}
String opponentName = (opponentIsHome ? "@" : "") + opponentTeam.getName();
bufferedWriter.write(String.format("%-" + (maximumTeamNameLength + 3) + "s", opponentName));

if (opponentTeam != null) {
String opponentName = (opponentIsHome ? "@" : "") + opponentTeam.getName();
bufferedWriter.write(String.format("%-" + (maximumTeamNameLength + 3) + "s", opponentName));
}
}
bufferedWriter.write("\n");
}
Expand Down

0 comments on commit 6e854ca

Please sign in to comment.