Fixed nullpointer when creating iterator on TreeMap where root node is null.

This commit is contained in:
Steve Hannah 2015-05-14 09:53:32 -07:00
parent e8df0a86de
commit 279fa86a3c

View File

@ -691,7 +691,7 @@ public class TTreeMap<K, V> extends TAbstractMap<K, V> implements TCloneable, TS
public EntryIterator(TTreeMap<K, V> owner, TreeNode<K, V>[] path, TreeNode<K, V> to, boolean reverse) {
this.owner = owner;
modCount = owner.modCount;
this.path = TArrays.copyOf(path, owner.root.height);
this.path = TArrays.copyOf(path, owner.root == null ? 0 : owner.root.height);
depth = path.length;
this.to = to;
this.reverse = reverse;