From 643c1b0cff1c62557b1ea2ff0345824b4a43045a Mon Sep 17 00:00:00 2001 From: nonaninona Date: Tue, 20 Feb 2024 02:12:50 +0900 Subject: [PATCH] =?UTF-8?q?Hotfix:=20=EC=B1=84=ED=8C=85=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20API=20=ED=95=B4=EB=8B=B9=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EC=B1=84=ED=8C=85=20=EC=97=86=EC=9D=84=20=EB=95=8C=20=EB=B9=88?= =?UTF-8?q?=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/kuit/chatdiary/service/ChatService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/kuit/chatdiary/service/ChatService.java b/src/main/java/com/kuit/chatdiary/service/ChatService.java index 486fb1b..1cb1bde 100644 --- a/src/main/java/com/kuit/chatdiary/service/ChatService.java +++ b/src/main/java/com/kuit/chatdiary/service/ChatService.java @@ -10,6 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -74,7 +75,7 @@ public List getChats(Long userId, Long lastChatId) { List chats = chatRepository.findTop10ByUserIdAndChatIdGreaterThanOrderByChatIdDesc(userId, lastChatId); System.out.println(chats); if (chats.isEmpty()) { - return null; + return new ArrayList<>(); } return chats.stream() .map(ChatGetResponseDTO::new)