diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 8bb4d60e1d..07141e897e 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -3440,7 +3440,7 @@ void wxListMainWindow::SetFocus() wxWindow *oldFocus = FindFocus(); - if ( oldFocus->GetParent() == this ) + if ( oldFocus && oldFocus->GetParent() == this ) { wxWindow::SetFocus(); }