Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3338

@MatchMedia: NPE in BinderImpl if cookies are null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.0.2
    • Fix Version/s: 8.0.4
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      problem description

      Reproducible on first load when client has no cookies.

      steps to reproduce

      1. clear all cookies with chrome developer tool
      2. load the 3338.zul

      current result

      NullPointerException - cookies can be null.

      2016-09-23 09:37:45.388:WARN::/uipattern/3338.zul
      java.lang.NullPointerException
      at org.zkoss.bind.impl.BinderImpl.init(BinderImpl.java:354)
      at org.zkoss.bind.AnnotateBinder.init(AnnotateBinder.java:58)
      at org.zkoss.bind.BindComposer.doBeforeComposeChildren(BindComposer.java:164)
      at org.zkoss.zk.ui.impl.UiEngineImpl.doBeforeComposeChildren(UiEngineImpl.java:997)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:937)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:895)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:777)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:841)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:797)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:740)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:460)
      at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:369)
      at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:211)
      at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:137)

      expected result

      no exception.

      root cause

      https://github.com/zkoss/zk/blob/master/zkbind/src/org/zkoss/bind/impl/BinderImpl.java

      Line 354:
      for (Cookie c : cookies) {

      debug info

        Attachments

        1. 3338.zul
          0.1 kB
        2. MatchMediaVM.java
          0.2 kB

          Issue Links

            Activity

              People

              • Assignee:
                wenninghsu wenninghsu
                Reporter:
                dminik dminik
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h