feat: lecture, quiz 이미지 미포함 등록 불가 수정

This commit is contained in:
kgc91747 2024-08-12 15:26:04 +09:00
parent a0b363d74f
commit 4cd713f580
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ public class LectureController {
return new ResponseEntity<>(HttpStatus.CONFLICT);
}
if (!image.isEmpty() && !image.getContentType().startsWith("image")) {
if (image != null && !image.getContentType().startsWith("image")) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}

View File

@ -39,7 +39,7 @@ public class QuizController {
}
for (MultipartFile image : images) {
if (!image.isEmpty() && !image.getContentType().startsWith("image")) {
if (image != null && !image.getContentType().startsWith("image")) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}
@ -88,7 +88,7 @@ public class QuizController {
}
for (MultipartFile image : images) {
if (!image.isEmpty() && !image.getContentType().startsWith("image")) {
if (image != null && !image.getContentType().startsWith("image")) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
}