diff --git a/src/wxmac/src/mac/wx_frame.cc b/src/wxmac/src/mac/wx_frame.cc index 973ee2ab77..1295d32afe 100644 --- a/src/wxmac/src/mac/wx_frame.cc +++ b/src/wxmac/src/mac/wx_frame.cc @@ -927,11 +927,13 @@ void wxFrame::ShowAsActive(Bool flag) if (!(cStyle & wxFLOAT_FRAME) || !(cStyle & wxNO_CAPTION)) { TakeoverFocus(); - cFocusWindow->OnSetFocus(); + if (cFocusWindow) + cFocusWindow->OnSetFocus(); } } else { ReleaseFocus(); - cFocusWindow->OnKillFocus(); + if (cFocusWindow) + cFocusWindow->OnKillFocus(); } } }