Skip to content

Commit

Permalink
refactor: null 체크
Browse files Browse the repository at this point in the history
  • Loading branch information
jschoi-96 committed Mar 30, 2024
1 parent 57d68f7 commit 386e882
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ public void delete(final LoginRequest loginRequest, HttpServletRequest request)
}

List<Post> posts = member.getPosts();
for (Post post : posts) {
post.removeMember();
if (posts != null) {
for (Post post : posts) {
post.removeMember();
}
}
memberRepository.deleteByEmail(member.getEmail());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ void deleteMemberSuccess() {
when(passwordEncoder.matches(loginRequest.getPassword(), member.getPassword())).thenReturn(true);

// when

memberService.delete(loginRequest, request);

// then
Expand Down

0 comments on commit 386e882

Please sign in to comment.