diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TCollections.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TCollections.java index 6816aea8e..b9417c35f 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TCollections.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TCollections.java @@ -253,6 +253,9 @@ public class TCollections extends TObject { } int l = 0; int u = list.size() - 1; + if (u < 0) { + return -1; + } while (true) { int i = (l + u) / 2; T e = list.get(i);