diff --git a/api/src/main/java/ca/bc/gov/educ/api/distribution/util/EducDistributionApiUtils.java b/api/src/main/java/ca/bc/gov/educ/api/distribution/util/EducDistributionApiUtils.java index 147543f..20891db 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/distribution/util/EducDistributionApiUtils.java +++ b/api/src/main/java/ca/bc/gov/educ/api/distribution/util/EducDistributionApiUtils.java @@ -254,11 +254,14 @@ public static synchronized void zipFile(File fileToZip, String fileName, ZipOutp } } - private static Date toLastDayOfMonth(Date date) { - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); - return cal.getTime(); + static Date toLastDayOfMonth(Date date) { + if(date != null) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH)); + return cal.getTime(); + } + return null; } /**