From d5a53acc9e4fd7ccdb50d5f43f87fad893b85ae2 Mon Sep 17 00:00:00 2001 From: LHS-11 Date: Tue, 2 Jan 2024 22:51:25 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EA=B4=80=EC=8B=AC=20=EC=A0=95?= =?UTF-8?q?=EC=B1=85=20=EB=93=B1=EB=A1=9D=20API=20null=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/userpolicy/application/UserPolicyService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cmc/zenefitserver/domain/userpolicy/application/UserPolicyService.java b/src/main/java/com/cmc/zenefitserver/domain/userpolicy/application/UserPolicyService.java index e03c039..e30a1d5 100644 --- a/src/main/java/com/cmc/zenefitserver/domain/userpolicy/application/UserPolicyService.java +++ b/src/main/java/com/cmc/zenefitserver/domain/userpolicy/application/UserPolicyService.java @@ -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)