From 3aaf3153a4b5bfca6f5237fa5451e6a943d3783a Mon Sep 17 00:00:00 2001 From: Jeongmo Seo Date: Wed, 9 Jul 2025 20:59:37 +0900 Subject: [PATCH] =?UTF-8?q?:bug:=20fix:=20=EC=BF=A0=ED=82=A4=20NPE=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../withtime/be/withtimebe/global/util/CookieUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/withtime/be/withtimebe/global/util/CookieUtil.java b/src/main/java/org/withtime/be/withtimebe/global/util/CookieUtil.java index 1df0dfa..96eb7f4 100644 --- a/src/main/java/org/withtime/be/withtimebe/global/util/CookieUtil.java +++ b/src/main/java/org/withtime/be/withtimebe/global/util/CookieUtil.java @@ -25,9 +25,11 @@ public static void addCookie(HttpServletRequest request, HttpServletResponse res public static String getCookie(HttpServletRequest request, String name) { Cookie[] cookies = request.getCookies(); - for (Cookie cookie : cookies) { - if (cookie.getName().equals(name)) { - return cookie.getValue(); + if (cookies != null) { + for (Cookie cookie : cookies) { + if (cookie.getName().equals(name)) { + return cookie.getValue(); + } } } return null;