Correct index out of bounds exception in focusGoDown

Adds a check to stop treeList at the second last item instead of allowing the list index to go negative.

Fixes#17
This commit is contained in:
lmann99 2017-01-26 00:46:46 -05:00
parent d1c6144ae3
commit 737967c2f8

View file

@ -609,7 +609,7 @@ public abstract class TreeController<T extends ITreeNode<T>> extends GenericForw
int myPosition = parent.getIndex();
if (myPosition < treeItems.size() - 1) {
if ((myPosition < treeItems.size() - 1) && myPosition > 0) {
// The current node is not the last one
Treerow downTreerow = treeItems.get(myPosition + 1).getTreerow();