Skip to content

Commit

Permalink
fix : 정책 상세 조회에서 NullPointerException 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Jan 2, 2024
1 parent aa5c4d7 commit fabce38
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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();
Expand Down

0 comments on commit fabce38

Please sign in to comment.