]> git.saurik.com Git - wxWidgets.git/commitdiff
Crash fix for when a wxNullBitmap is passed in as the bitmap to use.
authorKevin Ollivier <kevino@theolliviers.com>
Sun, 8 Feb 2009 23:08:20 +0000 (23:08 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sun, 8 Feb 2009 23:08:20 +0000 (23:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58782 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/bmpbuttn.mm

index fd5f716ff8a2361dc59e78e44512b9109cf3e625..f6fbea347648606ad869c69ef3348cd806d5749f 100644 (file)
@@ -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;