diff --git a/src/main/java/com/hanaro/triptogether/team/service/impl/TeamServiceImpl.java b/src/main/java/com/hanaro/triptogether/team/service/impl/TeamServiceImpl.java index 1fb6ee5..1520b8f 100644 --- a/src/main/java/com/hanaro/triptogether/team/service/impl/TeamServiceImpl.java +++ b/src/main/java/com/hanaro/triptogether/team/service/impl/TeamServiceImpl.java @@ -68,9 +68,11 @@ public void addTeam(AddTeamReqDto addTeamReqDto) { public DetailTeamResDto detailTeam(DetailTeamReqDto detailTeamReqDto) { Team team = teamRepository.findById(detailTeamReqDto.getTeamIdx()).orElseThrow(() -> new ApiException(ExceptionEnum.TEAM_NOT_FOUND)); TeamMember teamMember = teamMemberRepository.findById(detailTeamReqDto.getTeamMemberIdx()).orElseThrow(() -> new ApiException(ExceptionEnum.TEAM_MEMBER_NOT_FOUND)); + Long preferTripIdx = null; + if(team.getPreferTrip()!=null) preferTripIdx = team.getPreferTrip().getTripIdx(); return DetailTeamResDto.builder() - .preferTripIdx(team.getPreferTrip().getTripIdx()) + .preferTripIdx(preferTripIdx) .teamNotice(team.getTeamNotice()) .teamName(team.getTeamName()) .accNumber(team.getAccount().getAccNumber())