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

PathELResolver.getValue cause a NPE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 8.5.0
    • Fix Version/s: 8.5.2
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.5.2 S2

      Description

      getValue is causing a NPE on numOfKids = _numOfKids.removeFirst(); because _numOfKids is null.

      public Object getValue(ELContext ctx, Object base, Object property)
      			throws NullPointerException, PropertyNotFoundException, ELException {
      		if (ctx == null) {
      			throw new NullPointerException();
      		}
      		Integer numOfKids;
      		Path path;
      		if (base == null) { //init
      			numOfKids = (Integer) ctx.getContext(AstIdentifier.class); //Number of siblings of AstIdentifier
      			path = new Path();
      		} else {
      			*numOfKids = _numOfKids.removeFirst();*
      			path = _paths.removeFirst();
      		}
      

      I have a zul page that calls a custom function defined in a tld file.

      <listcell sclass="h20" label="@load(c:getMatchCompetitors(ma).date)"></listcell>

      If i see the stack trace, the return value is correct. and also the properties are correct (i have a date property)
      The NPE is caused whe trying to remove an element from an empty list. A test on empty should be executed before removing it
      A similar test is present in getType method

        Activity

        Hide
        Anonymous added a comment -

        Fixed since 2018/06/28

        Show
        Anonymous added a comment - Fixed since 2018/06/28

          People

          • Assignee:
            klyvechen klyvechen
            Reporter:
            afxgroup afxgroup
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 day
              1d
              Remaining:
              Remaining Estimate - 1 day
              1d
              Logged:
              Time Spent - Not Specified
              Not Specified

                Agile