From affcec50e4b4f322ad6cc219a91f5384a0468aaf Mon Sep 17 00:00:00 2001 From: richardash1981 Date: Thu, 22 Dec 2011 22:36:20 +0000 Subject: [PATCH] Do not try and focus an item which isn't there if there is no history - patch by Leland --- src/HistoryWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/HistoryWindow.cpp b/src/HistoryWindow.cpp index d7df3a76f..3fd988de0 100644 --- a/src/HistoryWindow.cpp +++ b/src/HistoryWindow.cpp @@ -240,7 +240,8 @@ void HistoryWindow::OnSize(wxSizeEvent & event) { Layout(); mList->SetColumnWidth(0, mList->GetClientSize().x - mList->GetColumnWidth(1)); - mList->EnsureVisible(mSelected); + if (mList->GetItemCount() > 0) + mList->EnsureVisible(mSelected); } void HistoryWindow::OnChar(wxKeyEvent &event)