From d146778d4ac3866c6594a7edd6db63cdd92e1c00 Mon Sep 17 00:00:00 2001 From: leejeongjun Date: Mon, 27 May 2024 13:51:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=B1=84=ED=8C=85=EC=97=90=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EC=97=85=EB=A1=9C=EB=93=9C=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=EC=97=90=EC=84=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=EA=B0=80=20=EC=A0=84=EB=8B=AC=EB=90=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EC=95=98=EC=9D=84=20=EB=95=8C=20=EC=98=88=EC=99=B8=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kr/co/ssalon/web/controller/ChatController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/back-end/src/main/java/kr/co/ssalon/web/controller/ChatController.java b/back-end/src/main/java/kr/co/ssalon/web/controller/ChatController.java index c1eb91e4..2e8575ea 100644 --- a/back-end/src/main/java/kr/co/ssalon/web/controller/ChatController.java +++ b/back-end/src/main/java/kr/co/ssalon/web/controller/ChatController.java @@ -50,9 +50,10 @@ public MessageResponseDTO chat(SimpMessageHeaderAccessor accessor, @DestinationV Member member = memberService.findMember(username); Meeting meeting = meetingService.findMeeting(roomId); - String imageUrl = Objects.equals(messageType, "ENTER") - ? "" - : chatService.changeImageBytesToUrl(messageRequestDTO.getImageBytes(), messageRequestDTO.getFileName(), roomId); + String imageUrl = ""; + if (messageRequestDTO.getImageBytes() != null && messageRequestDTO.getFileName() != null) { + imageUrl = chatService.changeImageBytesToUrl(messageRequestDTO.getImageBytes(), messageRequestDTO.getFileName(), roomId); + } // 채팅 메시지 저장 MessageResponseDTO messageResponseDTO = chatService.saveMessage(member, meeting, messageRequestDTO.getMessage(), messageType, imageUrl);