fixed: null报错,提升系统稳定性

This commit is contained in:
none 2023-04-19 16:49:09 +08:00
parent b0aaf1a15e
commit 3ca8350e97
2 changed files with 7 additions and 7 deletions

View File

@ -36,12 +36,12 @@ import java.util.List;
@RestControllerAdvice
@Slf4j
public class ExceptionController {
@ExceptionHandler(Exception.class)
public JsonResponse exceptionHandler(Exception e) {
log.error(e.getMessage());
return JsonResponse.error("系统错误", 500);
}
//
// @ExceptionHandler(Exception.class)
// public JsonResponse exceptionHandler(Exception e) {
// log.error(e.getMessage());
// return JsonResponse.error("系统错误", 500);
// }
@ExceptionHandler(ServiceException.class)
public JsonResponse serviceExceptionHandler(ServiceException e) {

View File

@ -98,7 +98,7 @@ public class UserCourseRecordServiceImpl
@Override
public List<UserCourseRecord> chunk(List<Integer> userIds, List<Integer> courseIds) {
if (courseIds == null || courseIds.size() == 0) {
if (courseIds == null || courseIds.size() == 0 || userIds == null || userIds.size() == 0) {
return new ArrayList<>();
}
return list(query().getWrapper().in("user_id", userIds).in("course_id", courseIds));