-
Bug
-
Resolution: Fixed
-
Normal
-
6.5.8.1, 9.5.0.2
-
Security Level: Jimmy
-
None
Steps to Reproduce
run attached unit test TreeRenderByPathTest.java
Current Result
exception when the path is just 1 greater than the children size
java.lang.IndexOutOfBoundsException: Index: 3 at java.base/java.util.AbstractSequentialList.get(AbstractSequentialList.java:90) at org.zkoss.zul.Tree.renderItemByPath(Tree.java:2562) at TreeRenderByPathTest.test(TreeRenderByPathTest.java:45)
Expected Result
no exception, if the path is incorrect
return null as in the negative index case or any other case of incorrect path
Debug Information
https://github.com/zkoss/zk/blob/v9.5.0.2/zul/src/org/zkoss/zul/Tree.java#L2558
condition should be using >=