diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java index 585944995..3b265c1c4 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java @@ -691,7 +691,7 @@ public class TTreeMap extends TAbstractMap implements TCloneable, TS public EntryIterator(TTreeMap owner, TreeNode[] path, TreeNode 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;