Skip to content

Commit

Permalink
feat : 관심 정책 등록 API null 처리 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Jan 2, 2024
1 parent 19d4cdb commit d5a53ac
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public void saveInterestPolicy(User user, Long policyId) {
UserPolicy findUserPolicy = userPolicyRepository.findByUser_userIdAndPolicy_Id(findUser.getUserId(), findPolicy.getId())
.orElse(null);

if (findUserPolicy.isInterestFlag()) {
if (findUserPolicy != null && findUserPolicy.isInterestFlag()) {
throw new BusinessException(ErrorCode.ALREADY_EXISTS_INTEREST_USER_POLICY);
}

if (findUserPolicy != null && findUserPolicy == null) {
if (findUserPolicy == null) {
findUserPolicy = UserPolicy.builder()
.user(findUser)
.policy(findPolicy)
Expand Down

0 comments on commit d5a53ac

Please sign in to comment.