diff --git a/teavm-core/src/main/java/org/teavm/debugging/information/ExactMethodIterator.java b/teavm-core/src/main/java/org/teavm/debugging/information/ExactMethodIterator.java index 18a6e1e21..4bffca6b6 100644 --- a/teavm-core/src/main/java/org/teavm/debugging/information/ExactMethodIterator.java +++ b/teavm-core/src/main/java/org/teavm/debugging/information/ExactMethodIterator.java @@ -33,7 +33,9 @@ public class ExactMethodIterator { ExactMethodIterator(DebugInformation debugInformation) { this.debugInformation = debugInformation; - read(); + if (!isEndReached()) { + read(); + } } public boolean isEndReached() { diff --git a/teavm-core/src/main/java/org/teavm/debugging/information/SourceLocationIterator.java b/teavm-core/src/main/java/org/teavm/debugging/information/SourceLocationIterator.java index db1af520a..2699fe4aa 100644 --- a/teavm-core/src/main/java/org/teavm/debugging/information/SourceLocationIterator.java +++ b/teavm-core/src/main/java/org/teavm/debugging/information/SourceLocationIterator.java @@ -31,7 +31,9 @@ public class SourceLocationIterator { SourceLocationIterator(DebugInformation debugInformation) { this.debugInformation = debugInformation; - read(); + if (!isEndReached()) { + read(); + } } public boolean isEndReached() {