diff --git a/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java index 5e5ae6c..23cff82 100644 --- a/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsStudentManageServiceImpl.java @@ -69,14 +69,20 @@ public class UmsStudentManageServiceImpl extends ServiceImpl umsStudentManageList = umsStudentManages.stream() - .filter(studentManage -> studentManage.getName().contains(umsStudentPageQueryDTO.getName())) + .filter(studentManage -> + studentManage != null && + studentManage.getName() != null && + studentManage.getName().contains(umsStudentPageQueryDTO.getName())) .skip((umsStudentPageQueryDTO.getPage() - 1) * umsStudentPageQueryDTO.getPageSize()) .limit(umsStudentPageQueryDTO.getPageSize()) .collect(Collectors.toList()); result.put("Records", umsStudentManageList); }else if (umsStudentPageQueryDTO.getNumber() != null){ List umsStudentManageList = umsStudentManages.stream() - .filter(studentManage -> studentManage.getNumber().contains(umsStudentPageQueryDTO.getNumber())) + .filter(studentManage -> + studentManage != null && + studentManage.getNumber() != null && + studentManage.getNumber().contains(umsStudentPageQueryDTO.getNumber())) .skip((umsStudentPageQueryDTO.getPage() - 1) * umsStudentPageQueryDTO.getPageSize()) .limit(umsStudentPageQueryDTO.getPageSize()) .collect(Collectors.toList());