Skip to content

Commit afe71ec

Browse files
javier-godoymlopezFC
authored andcommitted
fix: remove from history after iterator has been nulled
1 parent b5d04ce commit afe71ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/flowingcode/vaadin/addons/xterm/TerminalHistory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ public void add(String line) {
153153
if (!line.isEmpty()) {
154154
history.add(Objects.requireNonNull(line));
155155
iterator = null;
156-
}
157-
if (maxSize != null && history.size() > maxSize) {
158-
history.removeLast();
156+
if (maxSize != null && history.size() > maxSize) {
157+
history.removeLast();
158+
}
159159
}
160160
}
161161

0 commit comments

Comments
 (0)