Skip to content

Commit

Permalink
[FIXED JENKINS-4934] Do not plot or save plot data for deleted builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Nielsen committed Oct 28, 2013
1 parent 09c627b commit 7731e71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/hudson/plugins/plot/Plot.java
Expand Up @@ -542,7 +542,8 @@ public String numDateString() {
int buildNum;
try {
buildNum = Integer.valueOf(record[2]);
if (buildNum > getRightBuildNum()) {
if (project.getBuildByNumber(buildNum) == null
|| buildNum > getRightBuildNum()) {
continue; // skip this record
}
} catch (NumberFormatException nfe) {
Expand Down Expand Up @@ -732,7 +733,9 @@ private void savePlotData() {
writer.writeNext(header2);
// write each entry of rawPlotData to a new line in the CSV file
for (String[] entry : rawPlotData) {
writer.writeNext(entry);
if (project.getBuildByNumber(Integer.parseInt(entry[2])) != null) {
writer.writeNext(entry);
}
}
} catch (IOException ioe) {
//ignore
Expand Down

0 comments on commit 7731e71

Please sign in to comment.