]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
added Mark Newsam's patch
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index 4e6f8737b833291df03dbfc4d4b6a19c7ae7d012..44af0896241b39ac646a4fc6839b91b37d5a0521 100644 (file)
@@ -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 ;