X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb45bb1fb231dd982d5196766dbca2ce161c0ea4..8ce0312ea0f0c1981571cc4fff7c063e30d32d3f:/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:)]; + } }