From c5e6eb928a9afe45f02c61e3ee2787ac7668126b Mon Sep 17 00:00:00 2001 From: arybakov Date: Thu, 27 Jun 2024 09:25:45 -0600 Subject: [PATCH] GRAD2-2799-P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates- edit summary P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates --- .../util/EducGradBatchGraduationApiUtils.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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; } }