X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb45bb1fb231dd982d5196766dbca2ce161c0ea4..24e97652b0f3a5796c3fab61d87b1f636d64ce79:/src/cocoa/NSButton.mm diff --git a/src/cocoa/NSButton.mm b/src/cocoa/NSButton.mm index c228460dd4..b9923b7f7f 100644 --- a/src/cocoa/NSButton.mm +++ b/src/cocoa/NSButton.mm @@ -57,8 +57,11 @@ WX_IMPLEMENT_POSER(wxPoserNSButton); void wxCocoaNSButton::AssociateNSButton(WX_NSButton cocoaNSButton) { - sm_cocoaHash.insert(wxCocoaNSButtonHash::value_type(cocoaNSButton,this)); - [cocoaNSButton setTarget: cocoaNSButton]; - [cocoaNSButton setAction: @selector(wxNSButtonAction:)]; + if(cocoaNSButton) + { + sm_cocoaHash.insert(wxCocoaNSButtonHash::value_type(cocoaNSButton,this)); + [cocoaNSButton setTarget: cocoaNSButton]; + [cocoaNSButton setAction: @selector(wxNSButtonAction:)]; + } }