You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/09/27 13:02:10 UTC

[myfaces-tobago] branch master updated: "better version of unused code"

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 37d7e86  "better version of unused code"
37d7e86 is described below

commit 37d7e8689e29803ecfcc49012fe232c790861a48
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Wed Sep 27 15:02:05 2017 +0200

    "better version of unused code"
---
 .../org/apache/myfaces/tobago/internal/util/CookieUtils.java  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/CookieUtils.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/CookieUtils.java
index b37dcf1..ad391b1 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/CookieUtils.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/CookieUtils.java
@@ -109,10 +109,13 @@ public class CookieUtils {
     String path = request.getContextPath();
     path = StringUtils.isBlank(path) ? "/" : path;
     final Cookie[] cookies = request.getCookies();
-    for (Cookie cookie : cookies) {
-      if (THEME_PARAMETER.equals(cookie.getName())) {
-        cookie.setMaxAge(0);
-        response.addCookie(cookie);
+    if (cookies != null) {
+      for (Cookie cookie : cookies) {
+        if (THEME_PARAMETER.equals(cookie.getName())) {
+          cookie.setMaxAge(0);
+          cookie.setValue(null);
+          response.addCookie(cookie);
+        }
       }
     }
   }

-- 
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <co...@myfaces.apache.org>'].