diff --git a/src/widgets/wxPanelWrapper.cpp b/src/widgets/wxPanelWrapper.cpp index d4bee55bf..3cea4c659 100644 --- a/src/widgets/wxPanelWrapper.cpp +++ b/src/widgets/wxPanelWrapper.cpp @@ -18,7 +18,9 @@ void wxTabTraversalWrapperCharHook(wxKeyEvent &event) if (event.GetKeyCode() == WXK_TAB) { auto focus = wxWindow::FindFocus(); if (dynamic_cast(focus) - || (focus && dynamic_cast(focus->GetParent()->GetParent()))) { + || (focus && + focus->GetParent() && + dynamic_cast(focus->GetParent()->GetParent()))) { // Let wxGrid do its own TAB key handling event.Skip(); return;