[Bug #1202] Managed division by zero calculating template averages
It's valid to return a 0 value when the the template has never been asigned, so there are 0 items to calculate the average used time. FEA: ItEr75S04BugFixing
This commit is contained in:
parent
88bbc256e2
commit
24b0cf6db5
1 changed files with 2 additions and 1 deletions
|
|
@ -352,7 +352,8 @@ public class EffortDuration implements Comparable<EffortDuration> {
|
|||
}
|
||||
|
||||
public static EffortDuration average(EffortDuration total, int items) {
|
||||
return EffortDuration.seconds(total.seconds / items);
|
||||
return EffortDuration.seconds((items != 0) ? (total.seconds / items)
|
||||
: total.seconds);
|
||||
}
|
||||
|
||||
private static int roundHalfUpToHours(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue