]> git.saurik.com Git - wxWidgets.git/commitdiff
don't crash if editing of the cell wasn't started for whatever reason (patch 502692)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Feb 2002 16:17:13 +0000 (16:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Feb 2002 16:17:13 +0000 (16:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index fc1b7ced2a60aa26344aa7c9e52fbbf46f09b973..b6afb0c214aab8b69b1c46d0e6910a1694913d85 100644 (file)
@@ -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
                     {