Guarding call to wxOSXDrawNSImage with a valid m_cgContext

Fixes #18356
This commit is contained in:
Stefan Csomor
2019-03-10 09:54:08 +01:00
parent e8395fb88c
commit 099de4ecab

View File

@@ -2213,6 +2213,7 @@ void wxMacCoreGraphicsContext::Rotate( wxDouble angle )
void wxMacCoreGraphicsContext::DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h )
{
#if wxOSX_USE_COCOA
if (EnsureIsValid())
{
CGRect r = CGRectMake( (CGFloat) x , (CGFloat) y , (CGFloat) w , (CGFloat) h );
wxOSXDrawNSImage( m_cgContext, &r, bmp.GetImage());