From c00055bf7aaedfd719cf019d218c093f5263e39d Mon Sep 17 00:00:00 2001 From: Alexander Rybakov <83988488+arybakov-cgi@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:22:31 -0600 Subject: [PATCH] GRAD2-2799-P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates- edit summary (#266) P3 GRAD Incident: REGALG is creating SCCP certificates for students with future completion dates --- .../distribution/util/EducDistributionApiUtils.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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; } /**