From 1e85ef81ad4332a105989fdc1222db6070b8de81 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Mon, 23 Mar 2015 14:40:37 -0500 Subject: [PATCH] IDEMPIERE-2072 get number of non business days between 2 dates / fix NPE --- org.adempiere.base/src/org/compiere/util/TimeUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/util/TimeUtil.java b/org.adempiere.base/src/org/compiere/util/TimeUtil.java index 68eeeb5e24..83bf44d58c 100644 --- a/org.adempiere.base/src/org/compiere/util/TimeUtil.java +++ b/org.adempiere.base/src/org/compiere/util/TimeUtil.java @@ -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++; }