Fixed possible OutOfBoundsException

FEA: ItEr74S04BugFixing
This commit is contained in:
Diego Pino Garcia 2011-05-04 12:29:32 +02:00
parent 938a6d852e
commit 51d4f8594b

View file

@ -221,6 +221,9 @@ public class StretchesFunctionModel implements IStretchesFunctionModel {
private static boolean theFirstIntervalIsPosteriorToFirstDay(
List<Stretch> stretches, LocalDate start) {
List<Interval> intervals = StretchesFunction.intervalsFor(stretches);
if (intervals.isEmpty()) {
return false;
}
Interval first = intervals.get(0);
return first.getEnd().compareTo(start) > 0;
}