Skip to content

Commit

Permalink
fix: certifyImageUrl Null 예외처리
Browse files Browse the repository at this point in the history
  • Loading branch information
daeunkwak committed Sep 8, 2023
1 parent 2a45e96 commit 318314f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
7 changes: 7 additions & 0 deletions cider-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ dependencies {
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

configurations.all {
resolutionStrategy {
force 'org.hibernate.bytecode:hibernate-bytecode:6.1.7.Final'
force 'net.bytebuddy:byte-buddy-dep:1.10.9'
}
}
}

jar{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ public class SimpleCertifyResponseDto {

public static SimpleCertifyResponseDto from(Certify certify) {

String url = "";
if(certify.getCertifyImageList().size() != 0){
url = certify.getCertifyImageList().get(0).getImageUrl();
}

return new SimpleCertifyResponseDtoBuilder()
.simpleMemberResponseDto(SimpleMemberResponseDto.from(certify.getParticipate().getMember()))
.certifyId(certify.getCertifyId())
.certifyImageUrl(certify.getCertifyImageList().get(0).getImageUrl())
.certifyImageUrl(url)
.createdDate(certify.getCreatedDate())
.certifyName(certify.getCertifyName())
.certifyContent(certify.getCertifyContent())
Expand All @@ -60,10 +65,15 @@ public static SimpleCertifyResponseDto from(Certify certify) {

public static SimpleCertifyResponseDto from(Certify certify, Boolean isLike) {

String url = "";
if(certify.getCertifyImageList().size() != 0){
url = certify.getCertifyImageList().get(0).getImageUrl();
}

return new SimpleCertifyResponseDtoBuilder()
.simpleMemberResponseDto(SimpleMemberResponseDto.from(certify.getParticipate().getMember()))
.certifyId(certify.getCertifyId())
.certifyImageUrl(certify.getCertifyImageList().get(0).getImageUrl())
.certifyImageUrl(url)
.createdDate(certify.getCreatedDate())
.certifyName(certify.getCertifyName())
.certifyContent(certify.getCertifyContent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,13 @@ public ResponseEntity<ChallengeDetailFeedResponseDto> getChallengeDetailFeed(Htt
Challenge challenge = challengeService.getChallenge(challengeId);
List<Certify> certifies = certifyService.getChallengeCertifyList(challenge, filter);

List<String> certifyImageUrlList = certifies.stream().map(certify -> {
return certify.getCertifyImageList().get(0).getImageUrl();
}).toList();
List<String> certifyImageUrlList = new ArrayList<>();

for(Certify certify : certifies){
if(certify.getCertifyImageList().size() != 0){
certifyImageUrlList.add(certify.getCertifyImageList().get(0).getImageUrl());
}
}

List<SimpleCertifyResponseDto> certifyResponseDtos = new ArrayList<>();
if (tokenString == null || tokenString.isEmpty()) { // 로그인 x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.modelmapper.internal.bytebuddy.build.Plugin;


@Data
@Builder
Expand Down

0 comments on commit 318314f

Please sign in to comment.