diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 9ab3864aa7cd..23a7e2595bda 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -423,7 +423,7 @@ void SvpSalFrame::UpdateSettings( AllSettings& rSettings ) aStdFont.SetFontSize(Size(0, 12)); aStyleSettings.SetMenuFont(aStdFont); - SvpSalGraphics* pGraphics = m_aGraphics.back(); + SvpSalGraphics* pGraphics = m_aGraphics.empty() ? nullptr : m_aGraphics.back(); bool bFreeGraphics = false; if (!pGraphics) {