X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ac2d1ca6c60d0bca4afc960a1d73dd7e105a22c1..799690a0a9e8dd5d5d57f06d70feb19811483e70:/src/mac/carbon/toplevel.cpp diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 4e6f8737b8..44af089624 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -252,7 +252,7 @@ pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef long keyval = wxMacTranslateKey(keychar, keycode) ; wxWindow* focus = wxWindow::FindFocus() ; - if ( wxTheApp->MacSendKeyDownEvent( focus , keyval , rec.modifiers , rec.when , rec.where.h , rec.where.v ) ) + if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent( focus , keyval , rec.modifiers , rec.when , rec.where.h , rec.where.v ) ) { // was handled internally result = noErr ;