Skip to content

Commit

Permalink
fix: 이미지가 Null이 아닌경우만 업로드 할 수 있도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
summit45 committed Nov 16, 2023
1 parent a951854 commit 6817f7f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/com/kusitms/jipbap/store/StoreService.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ public StoreDto registerStore(String email, RegisterStoreRequestDto dto, List<Mu
}

//이미지가 null이 아닌 경우 s3 업로드
for(int i=0; i<3; i++) {
if(image.get(i)!=null) {
try {
imageUri[i] = S3Utils.saveFile(amazonS3, bucket, image.get(i));
} catch (IOException e) {
throw new S3RegisterFailureException("가게 이미지 저장 중 오류가 발생했습니다.");
if(image != null && image.size() != 0) {
for(int i=0; i<3; i++) {
if(image.get(i)!=null) {
try {
imageUri[i] = S3Utils.saveFile(amazonS3, bucket, image.get(i));
} catch (IOException e) {
throw new S3RegisterFailureException("가게 이미지 저장 중 오류가 발생했습니다.");
}
}
}
}
Expand Down

0 comments on commit 6817f7f

Please sign in to comment.