diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx index a58c2d3723f1..5a15b6fb2592 100644 --- a/vcl/unx/kde5/KDE5SalFrame.cxx +++ b/vcl/unx/kde5/KDE5SalFrame.cxx @@ -340,7 +340,8 @@ void KDE5SalFrame::ReleaseGraphics( SalGraphics *pGraphics ) if( m_aGraphics[i].pGraphics.get() == pGraphics ) { m_aGraphics[i].bInUse = false; - cairo_surface_destroy( m_aGraphics[i].pSurface ); + if ( m_aGraphics[i].pSurface != nullptr ) + cairo_surface_destroy( m_aGraphics[i].pSurface ); break; } }