From: Vadim Zeitlin Date: Thu, 21 Feb 2002 16:17:13 +0000 (+0000) Subject: don't crash if editing of the cell wasn't started for whatever reason (patch 502692) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2f159c58497ee7a02ade43989e97d6fdc2f74839?ds=inline don't crash if editing of the cell wasn't started for whatever reason (patch 502692) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index fc1b7ced2a..b6afb0c214 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5832,7 +5832,14 @@ void wxGrid::OnKeyDown( wxKeyEvent& event ) || editor->IsAcceptedKey(event) ) { EnableCellEditControl(); - editor->StartingKey(event); + + // the editor could be not shown for a variety of + // reasons (i.e. blocked by the app or whatever), so + // check if it really was created + if ( m_cellEditCtrlEnabled ) + { + editor->StartingKey(event); + } } else {