Skip to content

Commit 50afdf9

Browse files
SR20290919SR20290919
authored andcommitted
adding required null checks
1 parent b95e4cc commit 50afdf9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/com/iemr/common/service/grievance/GrievanceHandlingServiceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ public String getGrievanceDetailsWithRemarks(String request) throws Exception {
429429
String fromDate = requestObj.optString("StartDate");
430430
String toDate = requestObj.optString("EndDate");
431431

432+
if (fromDate == null || toDate == null) {
433+
throw new IllegalArgumentException("fromDate and toDate are required");
434+
}
432435
// Convert StartDate and EndDate to Date objects
433436
Date startDateStr = parseDate(fromDate);
434437
Date endDateStr = parseDate(toDate);

0 commit comments

Comments
 (0)