Skip to content

Commit

Permalink
fix : findById Null 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
KJBig committed Oct 2, 2024
1 parent 0e378ec commit cf070ec
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public class UserDomainService {
private final UserRepository userRepository;

public User findById(Long userId) {
if (userId == null) {
return null;
}
return userRepository.findById(userId).orElseThrow(UserNotFoundException::new);
}

Expand Down

0 comments on commit cf070ec

Please sign in to comment.