From ba7c3571af620ebbc126d718a18116cd12db4545 Mon Sep 17 00:00:00 2001 From: mummhy0811 Date: Wed, 5 Jun 2024 13:32:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20preferTrip=20null=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../triptogether/team/service/impl/TeamServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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())