From: Kevin Ollivier Date: Sun, 8 Feb 2009 23:08:20 +0000 (+0000) Subject: Crash fix for when a wxNullBitmap is passed in as the bitmap to use. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6e23949a984101c8146869ad6d37753838f0a7ec?ds=inline Crash fix for when a wxNullBitmap is passed in as the bitmap to use. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58782 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/bmpbuttn.mm b/src/osx/cocoa/bmpbuttn.mm index fd5f716ff8..f6fbea3476 100644 --- a/src/osx/cocoa/bmpbuttn.mm +++ b/src/osx/cocoa/bmpbuttn.mm @@ -47,7 +47,9 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapButton( wxWindowMac* wxpeer, [v setBezelStyle:NSRegularSquareBezelStyle]; } - [v setImage:bitmap.GetNSImage() ]; + if (bitmap.Ok()) + [v setImage:bitmap.GetNSImage() ]; + [v setButtonType:NSMomentaryPushInButton]; wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v ); return c;