diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/controller/LectureController.java b/backend/src/main/java/com/edufocus/edufocus/lecture/controller/LectureController.java index dfe142c..3b15967 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/controller/LectureController.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/controller/LectureController.java @@ -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); } diff --git a/backend/src/main/java/com/edufocus/edufocus/quiz/controller/QuizController.java b/backend/src/main/java/com/edufocus/edufocus/quiz/controller/QuizController.java index 4a874c9..c9b2dbb 100644 --- a/backend/src/main/java/com/edufocus/edufocus/quiz/controller/QuizController.java +++ b/backend/src/main/java/com/edufocus/edufocus/quiz/controller/QuizController.java @@ -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); } }