From c3d4ed7dae366cc8be1b4ad78f9a5a42a9d7e5f0 Mon Sep 17 00:00:00 2001 From: liberhe <411497616@qq.com> Date: Wed, 13 Dec 2023 16:19:10 +0800 Subject: [PATCH] fix the bug --- src/main/java/com/dl/officialsite/member/MemberService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/dl/officialsite/member/MemberService.java b/src/main/java/com/dl/officialsite/member/MemberService.java index 1af9e9df..86652f4a 100644 --- a/src/main/java/com/dl/officialsite/member/MemberService.java +++ b/src/main/java/com/dl/officialsite/member/MemberService.java @@ -39,7 +39,7 @@ public MemberWithTeam getMemberWithTeamInfoByAddress(String address) { if(member.isPresent()) { MemberWithTeam memberWithTeam = new MemberWithTeam(); BeanUtils.copyProperties(member, memberWithTeam); - ArrayList teams = memberWithTeam.getTeams(); + ArrayList teams = new ArrayList(); List teamMembers = teamMemberRepository.findByMemberId(member.get().getId()); teamMembers.stream().forEach(teamMember -> { @@ -49,6 +49,7 @@ public MemberWithTeam getMemberWithTeamInfoByAddress(String address) { } teams.add(team); }); + memberWithTeam.setTeams(teams); return memberWithTeam; } return null;