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

PathELResolver.getValue cause a NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 8.5.2
    • 8.5.0
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.5.2 S2

      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

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

              Created:
              Updated:
              Resolved:

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