From 8950121d011a32cdaf48d847d7dcd6db757fd6e9 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 20 Jan 2015 18:45:20 +0400 Subject: [PATCH] Fix bug with source maps generator --- .../org/teavm/debugging/information/ExactMethodIterator.java | 4 +++- .../teavm/debugging/information/SourceLocationIterator.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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() {