Merge pull request #116 from shannah/fix_nullpointer_in_treemap

Fixed nullpointer when creating iterator on TreeMap where root node i…
This commit is contained in:
Alexey Andreev 2015-05-14 21:01:41 +03:00
commit 7b87df417d

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) { public EntryIterator(TTreeMap<K, V> owner, TreeNode<K, V>[] path, TreeNode<K, V> to, boolean reverse) {
this.owner = owner; this.owner = owner;
modCount = owner.modCount; 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; depth = path.length;
this.to = to; this.to = to;
this.reverse = reverse; this.reverse = reverse;