diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 2ac29b09b5..0eee46be33 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -3177,7 +3177,8 @@ void wxWidgetCocoaImpl::SetBackgroundColour( const wxColour &col ) wxTopLevelWindow* toplevel = wxDynamicCast(peer,wxTopLevelWindow); if ( toplevel == NULL || toplevel->GetShape().IsEmpty() ) - [targetView setBackgroundColor: col.OSXGetNSColor()]; + [targetView setBackgroundColor: + col.IsOk() ? col.OSXGetNSColor() : nil]; } } }