From 974170b70a28505e4b26109f45f9708bb595fc41 Mon Sep 17 00:00:00 2001 From: Oleg Shpynov Date: Wed, 24 Nov 2010 00:09:42 +0300 Subject: [PATCH] Better check whether history is not empty --- .../runners/AbstractConsoleRunnerWithHistory.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java b/platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java index ab3174bb3b0e..e60f7949924c 100644 --- a/platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java +++ b/platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java @@ -235,7 +235,9 @@ public abstract class AbstractConsoleRunnerWithHistory { if (lineNumber > 0){ caretModel.moveCaretRelatively(0, -1, false, consoleEditor.getSelectionModel().hasBlockSelection(), true); } else { - historyProcessor.process(e, myHistory.getHistoryPrev()); + if (myHistory.hasHistory(false)) { + historyProcessor.process(e, myHistory.getHistoryPrev()); + } } } }; @@ -246,7 +248,9 @@ public abstract class AbstractConsoleRunnerWithHistory { if (lineNumber < document.getLineCount() - 1){ caretModel.moveCaretRelatively(0, 1, false, consoleEditor.getSelectionModel().hasBlockSelection(), true); } else { - historyProcessor.process(e, myHistory.getHistoryNext()); + if (myHistory.hasHistory(true)) { + historyProcessor.process(e, myHistory.getHistoryNext()); + } } } };