From fabce3886dc3b708b1f3b706a78807cc60b0c18f Mon Sep 17 00:00:00 2001 From: LHS-11 Date: Wed, 3 Jan 2024 00:26:02 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EC=A0=95=EC=B1=85=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A1=B0=ED=9A=8C=EC=97=90=EC=84=9C=20NullPointerE?= =?UTF-8?q?xception=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/policy/application/PolicyService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java b/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java index c70defb..78934a0 100644 --- a/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java +++ b/src/main/java/com/cmc/zenefitserver/domain/policy/application/PolicyService.java @@ -68,7 +68,7 @@ public PolicyInfoResponseDto getPolicy(User user, Long policyId) { .orElseThrow(() -> new BusinessException(ErrorCode.NOT_FOUND_POLICY)); UserPolicy userPolicy = userPolicyRepository.findByUser_userIdAndPolicy_Id(user.getUserId(), policyId) - .orElseGet(null); + .orElseGet(() -> null); // 신청 불가 사유 로직 PolicyMethodType findPolicyMethodType = PolicyMethodType.findPolicyMethodTypeByKeywords(policy.getApplicationProcedureContent()); @@ -87,8 +87,8 @@ public PolicyInfoResponseDto getPolicy(User user, Long policyId) { .applicationSite(policy.getApplicationSiteAddress()) .referenceSite(policy.getReferenceSiteUrlAddress()) .benefit(policy.getBenefit()) - .applyFlag(userPolicy.isApplyFlag()) - .interestFlag(userPolicy.isInterestFlag()) + .applyFlag(userPolicy == null ? false : userPolicy.isApplyFlag()) + .interestFlag(userPolicy == null ? false : userPolicy.isInterestFlag()) .policyMethodType(findPolicyMethodType) .policyMethodTypeDescription(findPolicyMethodType.getDescription()) .build();