- 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:)];
+ }