From 79317e4ca1d023019f9a30cf7bed7b0231b57b71 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Wed, 5 Apr 2017 23:10:18 +0700 Subject: bugfix: null pointer exception --- .../com/juick/server/security/HashParamAuthenticationFilter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-server') diff --git a/juick-server/src/main/java/com/juick/server/security/HashParamAuthenticationFilter.java b/juick-server/src/main/java/com/juick/server/security/HashParamAuthenticationFilter.java index ce48adbe..d1358a20 100644 --- a/juick-server/src/main/java/com/juick/server/security/HashParamAuthenticationFilter.java +++ b/juick-server/src/main/java/com/juick/server/security/HashParamAuthenticationFilter.java @@ -76,8 +76,10 @@ public class HashParamAuthenticationFilter extends OncePerRequestFilter { if (hash == null) hash = request.getParameter(PARAM_NAME); - if (hash == null) - for (Cookie cookie : request.getCookies()) + Cookie[] cookies = request.getCookies(); + + if (hash == null && cookies != null) + for (Cookie cookie : cookies) if (PARAM_NAME.equals(cookie.getName())) { hash = cookie.getValue(); break; -- cgit v1.2.3