diff --git a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java index 708f45f8..8ea07499 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java +++ b/api/src/main/java/ca/bc/gov/educ/api/batchgraduation/util/EducGradBatchGraduationApiUtils.java @@ -89,11 +89,14 @@ public static String getProgramCompletionDate(Date pcd) { return dateFormat.format(pcd); } - 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; } }