diff --git a/backend/backend-submodule b/backend/backend-submodule index 66a9148b1..a0ae218a4 160000 --- a/backend/backend-submodule +++ b/backend/backend-submodule @@ -1 +1 @@ -Subproject commit 66a9148b1255e27d726281ff5be0dcbda3b87b7f +Subproject commit a0ae218a4ed50f41310e3eaf09a3ce8ca3d01e50 diff --git a/backend/src/main/java/hanglog/trip/service/ImageService.java b/backend/src/main/java/hanglog/trip/service/ImageService.java index 9bd3c9748..cbbd25e35 100644 --- a/backend/src/main/java/hanglog/trip/service/ImageService.java +++ b/backend/src/main/java/hanglog/trip/service/ImageService.java @@ -1,7 +1,6 @@ package hanglog.trip.service; -import static hanglog.global.exception.ExceptionCode.EMPTY_IMAGE_LIST; -import static hanglog.global.exception.ExceptionCode.EXCEED_IMAGE_LIST_SIZE; +import static hanglog.global.exception.ExceptionCode.*; import hanglog.global.exception.ImageException; import hanglog.image.domain.ImageFile; @@ -35,7 +34,11 @@ public ImagesResponse save(final List images) { private List uploadImages(final List imageFiles) { try { - return imageUploader.uploadImages(imageFiles); + final List uploadedImageNames = imageUploader.uploadImages(imageFiles); + if(uploadedImageNames.size() != imageFiles.size()) { + throw new ImageException(INVALID_IMAGE_PATH); + } + return uploadedImageNames; } catch (final ImageException e) { imageFiles.forEach(imageFile -> publisher.publishEvent(new S3ImageEvent(imageFile.getHashedName()))); throw e;