Skip to content

Commit

Permalink
HOTFIX: getImage Null 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
koreaioi committed Nov 13, 2024
1 parent a940dd2 commit 1f5f897
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ public record ChattingDto(
) {

public static ChattingDto of(User sender, User opponent, List<ChatMessageResponseDto> chatMessageList) {
String url = (opponent.getImage()==null) ? "" : opponent.getImage().getUrl();
return new ChattingDto(
sender.getId(), sender.getName(),
opponent.getId(), opponent.getName(), opponent.getImage().getUrl(),
opponent.getId(), opponent.getName(), url,
chatMessageList
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ public record ChattingListResponseDto(
LatestMessageDto latestMessageDto
) {
public static ChattingListResponseDto of(Long roomId, User sender, User opponent, LatestMessageDto latestMessageDto) {
String url = (opponent.getImage()==null) ? "" : opponent.getImage().getUrl();
return new ChattingListResponseDto(
roomId,
sender.getId(), sender.getName(),
opponent.getId(), opponent.getName(), opponent.getImage().getUrl(),
opponent.getId(), opponent.getName(), url,
latestMessageDto
);
}
Expand Down

0 comments on commit 1f5f897

Please sign in to comment.