Skip to content

Commit

Permalink
PLANNER-1540 Fix possible NPE in StatisticsUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
rsynek authored and ge0ffrey committed Jun 27, 2019
1 parent b0114b4 commit 400d9b4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public static double[] determineStandardDeviationDoubles(
}
}
}

if (differenceSquaredTotalDoubles == null) { // no successful benchmarks
return new double[0];
}

double[] standardDeviationDoubles = new double[differenceSquaredTotalDoubles.length];
for (int i = 0; i < differenceSquaredTotalDoubles.length; i++) {
standardDeviationDoubles[i] = Math.pow(differenceSquaredTotalDoubles[i] / successCount, 0.5);
Expand Down

0 comments on commit 400d9b4

Please sign in to comment.