From 0070b0bbf72a5fd3c1d1577330ec11d2ba6a2fc0 Mon Sep 17 00:00:00 2001 From: kim_sang_ june <79149384+drbug2000@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:02:29 +0900 Subject: [PATCH] [fix] null point handling --- .../java/space/space_spring/service/VoiceRoomService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/space/space_spring/service/VoiceRoomService.java b/src/main/java/space/space_spring/service/VoiceRoomService.java index c2d2ca82..d117c9ff 100644 --- a/src/main/java/space/space_spring/service/VoiceRoomService.java +++ b/src/main/java/space/space_spring/service/VoiceRoomService.java @@ -79,7 +79,7 @@ public List getVoiceRoomInfoList(long spaceId,Ge } //RoomDto에 값 집어넣기 //showParticipant = ture 일때, 참가자가 없으면 빈문자열[] 출력 - if(participantDtoList.isEmpty()||participantDtoList==null){ + if(participantDtoList==null||participantDtoList.isEmpty()){ System.out.print("\n\n[DEBUG]participant response is empty or null"+participantDtoList.toString()+ "participant number is \n\n"); roomDto.setParticipantDTOList(Collections.emptyList()); @@ -133,6 +133,9 @@ private List findBySpace(Space space){ private List getParticipantDtoListById(long voiceRoomId){ Space space = voiceRoomRepository.findById(voiceRoomId).getSpace(); List participantDtoList = liveKitUtils.getParticipantInfo(findNameTagById(voiceRoomId)); + if(participantDtoList==null||participantDtoList.isEmpty()){ + return Collections.emptyList(); + } for(ParticipantDto participantDto: participantDtoList){ //profileIamge 집어넣기 participantDto.setProfileImage(findProfileImageByUserId(participantDto.getId()));