ICEpush
  1. ICEpush
  2. PUSH-174

Cookie.readCookie method needs to check for null in secondary strategy

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1, EE 3.0.0
    • Fix Version/s: 3.1
    • Component/s: Push Library
    • Labels:
      None
    • Environment:
      ICEpush

      Description

      In our own org.icepush.http.standard.Cookie class, there is a readCookie method that tries a couple of different strategies to get at the request cookies.

      The code in the "backup" logic (after it tries to use getHeader() method which typically doesn't work with portlets) tries this alternative approach but doesn't check for null if nothing is returned:

              //PUSH-144: as the Cookie header may not always be available (e.g. portlets) we try an
              //alternate approach
              javax.servlet.http.Cookie[] treats = request.getCookies();
      --> need a null check here
              for (int i = 0; i < treats.length; i++) {
                  javax.servlet.http.Cookie treat = treats[i];
                  if (treat.getName().equalsIgnoreCase(cookieName)) {
                      return new Cookie(treat.getName(), treat.getValue());
                  }
              }

        Activity

        Hide
        Deryk Sinotte added a comment -

        Null check added.

        Show
        Deryk Sinotte added a comment - Null check added.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: