From a67b09772b0edd16e0dd07231b17bea89b9c5a74 Mon Sep 17 00:00:00 2001 From: kseysh Date: Fri, 19 Jul 2024 01:37:56 +0900 Subject: [PATCH] =?UTF-8?q?fix=20-=20#175=20userRecentLockDate=EA=B0=80=20?= =?UTF-8?q?null=EC=9D=BC=20=EB=95=8C=20NPE=EB=A5=BC=20=EB=B0=A9=EC=A7=80?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/sopt/org/hmh/domain/user/service/UserService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/sopt/org/hmh/domain/user/service/UserService.java b/src/main/java/sopt/org/hmh/domain/user/service/UserService.java index 55c63d1b..6682d188 100644 --- a/src/main/java/sopt/org/hmh/domain/user/service/UserService.java +++ b/src/main/java/sopt/org/hmh/domain/user/service/UserService.java @@ -129,8 +129,9 @@ public IsLockTodayResponse checkIsTodayLockDeprecated(Long userId, LocalDate loc @Transactional(readOnly = true) public IsLockTodayResponse checkIsTodayLock(Long userId, String timeZone) { + LocalDate now = LocalDate.now(ZoneId.of(timeZone)); LocalDate userRecentLockDate = this.findByIdOrThrowException(userId).getRecentLockDate(); - return new IsLockTodayResponse(userRecentLockDate.equals(LocalDate.now(ZoneId.of(timeZone)))); + return new IsLockTodayResponse(now.equals(userRecentLockDate)); } public void withdrawImmediately(Long userId) {