From 4d5c70eb95bb6f28fae81386a16790af1413e025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8A=B9=EC=A7=84?= Date: Sun, 14 Jan 2024 02:24:10 +0900 Subject: [PATCH] [HOTFIX] basetime null pointer exception --- .../java/com/twtw/backend/domain/friend/entity/Friend.java | 4 ++-- .../com/twtw/backend/domain/group/entity/GroupMember.java | 4 ++-- .../java/com/twtw/backend/domain/plan/entity/PlanMember.java | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/com/twtw/backend/domain/friend/entity/Friend.java b/backend/src/main/java/com/twtw/backend/domain/friend/entity/Friend.java index da01fd3f..7e036b7a 100644 --- a/backend/src/main/java/com/twtw/backend/domain/friend/entity/Friend.java +++ b/backend/src/main/java/com/twtw/backend/domain/friend/entity/Friend.java @@ -98,7 +98,7 @@ public void checkExpire() { } private boolean isRequestNotExpired() { - return this.friendStatus == FriendStatus.REQUESTED - && this.baseTime.getCreatedAt().isAfter(LocalDateTime.now().minusMinutes(30L)); + return this.baseTime == null || (this.friendStatus == FriendStatus.REQUESTED + && this.baseTime.getCreatedAt().isAfter(LocalDateTime.now().minusMinutes(30L))); } } diff --git a/backend/src/main/java/com/twtw/backend/domain/group/entity/GroupMember.java b/backend/src/main/java/com/twtw/backend/domain/group/entity/GroupMember.java index fcdcc45a..86add204 100644 --- a/backend/src/main/java/com/twtw/backend/domain/group/entity/GroupMember.java +++ b/backend/src/main/java/com/twtw/backend/domain/group/entity/GroupMember.java @@ -126,7 +126,7 @@ public void checkExpire() { } private boolean isRequestNotExpired() { - return this.groupInviteCode == GroupInviteCode.REQUESTED - && this.baseTime.getCreatedAt().isAfter(LocalDateTime.now().minusMinutes(30L)); + return this.baseTime == null || (this.groupInviteCode == GroupInviteCode.REQUESTED + && this.baseTime.getCreatedAt().isAfter(LocalDateTime.now().minusMinutes(30L))); } } diff --git a/backend/src/main/java/com/twtw/backend/domain/plan/entity/PlanMember.java b/backend/src/main/java/com/twtw/backend/domain/plan/entity/PlanMember.java index 809f0437..04028aaf 100644 --- a/backend/src/main/java/com/twtw/backend/domain/plan/entity/PlanMember.java +++ b/backend/src/main/java/com/twtw/backend/domain/plan/entity/PlanMember.java @@ -100,6 +100,7 @@ public String getDeviceTokenValue() { } private boolean isRequestNotExpired() { - return this.baseTime.getCreatedAt().isAfter(LocalDateTime.now().minusMinutes(30L)); + return this.baseTime == null || + (this.planInviteCode == PlanInviteCode.REQUESTED && this.baseTime.getCreatedAt().isAfter(LocalDateTime.now().minusMinutes(30L))); } }