From 664aa28005bf979ba47b9e5f4ef07d4249f70375 Mon Sep 17 00:00:00 2001 From: gabang2 Date: Thu, 26 Sep 2024 23:50:40 +0900 Subject: [PATCH] =?UTF-8?q?Hotfix:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=95=88=ED=95=9C=20=EC=9C=A0=EC=A0=80=EA=B0=80=20=ED=82=A4?= =?UTF-8?q?=EC=9B=8C=EB=93=9C=20=EA=B2=80=EC=83=89=ED=95=A0=20=EA=B2=BD?= =?UTF-8?q?=EC=9A=B0=20=EB=B6=84=EA=B8=B0=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../culturalevent/controller/CulturalEventController.java | 2 +- .../keyword/service/CulturalEventSearchKeywordService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/project/backend/domain/culturalevent/controller/CulturalEventController.java b/src/main/java/project/backend/domain/culturalevent/controller/CulturalEventController.java index 2a382d7..2093579 100644 --- a/src/main/java/project/backend/domain/culturalevent/controller/CulturalEventController.java +++ b/src/main/java/project/backend/domain/culturalevent/controller/CulturalEventController.java @@ -62,7 +62,7 @@ public ResponseEntity getCulturalEventList( Member member = memberJwtService.getMember(); // Save Search Keyword - if (keyword != null) { + if (keyword != null && member != null) { culturalEventSearchKeywordService.createCulturalEventSearchKeyword(member, keyword); } diff --git a/src/main/java/project/backend/domain/keyword/service/CulturalEventSearchKeywordService.java b/src/main/java/project/backend/domain/keyword/service/CulturalEventSearchKeywordService.java index 6649874..21dbd34 100644 --- a/src/main/java/project/backend/domain/keyword/service/CulturalEventSearchKeywordService.java +++ b/src/main/java/project/backend/domain/keyword/service/CulturalEventSearchKeywordService.java @@ -39,7 +39,7 @@ public class CulturalEventSearchKeywordService { public void createCulturalEventSearchKeyword(Member member, String keyword) { Optional culturalEventSearchKeywordOptional = culturalEventSearchKeywordRepository.findFirstByMemberAndKeywordAndIsRecentTrue(member, keyword); - if (culturalEventSearchKeywordOptional.isEmpty()) { + if (!culturalEventSearchKeywordOptional.isPresent()) { CulturalEventSearchKeyword culturalEventSearchKeyword = CulturalEventSearchKeyword.builder() .keyword(keyword).build(); culturalEventSearchKeyword.setMember(member);