Skip to content

Commit

Permalink
Merge pull request #177 from Team-HMH/develop
Browse files Browse the repository at this point in the history
hotfix - νšŒμ›κ°€μž…μ‹œ NPE λ°œμƒ 이슈
  • Loading branch information
kseysh authored Jul 15, 2024
2 parents 420ae4a + e552391 commit a094681
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class ChallengeFacade {
@Transactional
public Challenge addChallenge(Long userId, ChallengeRequest challengeRequest, String os) {
User user = userService.findByIdOrThrowException(userId);
Optional<Long> previousChallengeId = Optional.of(user.getCurrentChallengeId());

Optional<Long> previousChallengeId = Optional.ofNullable(user.getCurrentChallengeId());

Challenge challenge = challengeService.save(challengeRequest.toEntity(userId));
user.changeCurrentChallengeId(challenge.getId());
Expand Down

0 comments on commit a094681

Please sign in to comment.