From 6e23949a984101c8146869ad6d37753838f0a7ec Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Sun, 8 Feb 2009 23:08:20 +0000 Subject: [PATCH] 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 --- src/osx/cocoa/bmpbuttn.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.45.2