summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index cffda1e3..4989ae83 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -277,7 +277,8 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
if (mHistory)
{
// If the input is different from previous, put it in the history
- if (mHistory->empty() || !mHistory->matchesLastEntry(getText()))
+ if (!getText().empty() && (mHistory->empty() ||
+ !mHistory->matchesLastEntry(getText())))
{
mHistory->addEntry(getText());
}