You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using jsoup 1.21.1 to crawl some webpages and it crashed.
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
at java.base/java.util.Objects.checkIndex(Objects.java:385)
at java.base/java.util.ArrayList.remove(ArrayList.java:551)
at org.jsoup.parser.TreeBuilder.pop(TreeBuilder.java:163)
at org.jsoup.parser.HtmlTreeBuilderState$8.process(HtmlTreeBuilderState.java:998)
at org.jsoup.parser.HtmlTreeBuilder.process(HtmlTreeBuilder.java:174)
at org.jsoup.parser.TreeBuilder.stepParser(TreeBuilder.java:124)
at org.jsoup.parser.TreeBuilder.runParser(TreeBuilder.java:105)
at org.jsoup.parser.TreeBuilder.parse(TreeBuilder.java:76)
at org.jsoup.parser.Parser.parse(Parser.java:238)
Activity
jhy commentedon Jul 22, 2025
Hi Jesse,
Thanks for the report -- I can repro, and will review.
jhy commentedon Jul 22, 2025
OK, fixed!
Don't enter Text from Foreign
Correct the fixed version of #2374