Skip to content

Commit

Permalink
Merge pull request #279 from OutDecision/issue/168
Browse files Browse the repository at this point in the history
🎨 [UPDATE]: 칭호 빈문자열 에러 해결
  • Loading branch information
sye1101 authored May 31, 2024
2 parents e66cdcd + f357a4f commit 49cce28
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

@Service
@RequiredArgsConstructor
Expand Down Expand Up @@ -52,8 +53,10 @@ public List<String> myTitlesDTO() {
else throw new MemberHandler(ErrorStatus.MEMBER_NOT_FOUND);
// 문자열로 컬럼 이름 받아오기
String findTrueColumByMemberId = titleRepository.findTrueColumByMemberId(memberId);
// ','로 문자열 분류하여 리스트 만들어 반환
return Arrays.asList(findTrueColumByMemberId.split(","));
// ','로 문자열 분류하여 리스트 만들어 반환 및 빈 문자열 제거
return Arrays.stream(findTrueColumByMemberId.split(","))
.filter(s -> !s.trim().isEmpty())
.collect(Collectors.toList());
}

// 칭호 획득 가능 여부 확인
Expand Down

0 comments on commit 49cce28

Please sign in to comment.