From 471e25647f791731a7653174db3e83c20a088f32 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 15 Jun 2009 09:08:18 +0000 Subject: [PATCH] fix crash when pressing Down in command buffer and the history is empty (reported by John McCabe-Dansted's monkey test) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30107 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiCommandBuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiCommandBuffer.cpp b/src/frontends/qt4/GuiCommandBuffer.cpp index 0ce6cc7749..b562f56ad6 100644 --- a/src/frontends/qt4/GuiCommandBuffer.cpp +++ b/src/frontends/qt4/GuiCommandBuffer.cpp @@ -248,7 +248,8 @@ void GuiCommandBuffer::down() if (!h.empty()) edit_->setText(toqstr(h)); - downPB->setEnabled(history_pos_ != history_.end()-1); + downPB->setEnabled(!history_.empty() + && history_pos_ != history_.end() - 1); upPB->setEnabled(history_pos_ != history_.begin()); } -- 2.39.2