IDEMPIERE-2072 get number of non business days between 2 dates / fix NPE

This commit is contained in:
Nicolas Micoud 2015-03-23 14:40:37 -05:00
parent c1fe36259a
commit 1e85ef81ad
1 changed files with 1 additions and 1 deletions

View File

@ -866,7 +866,7 @@ public class TimeUtil
calEnd.set(Calendar.MILLISECOND, 0);
while (cal.before(calEnd) || cal.equals(calEnd)) {
if (!nbd.contains(new Timestamp(cal.getTimeInMillis()))) {
if (nbd == null || !nbd.contains(new Timestamp(cal.getTimeInMillis()))) {
if (cal.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && cal.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) {
retValue++;
}