diff --git a/src/gui/vector/qgsdiagramproperties.cpp b/src/gui/vector/qgsdiagramproperties.cpp index 81517c82bb88..1b9594207adf 100644 --- a/src/gui/vector/qgsdiagramproperties.cpp +++ b/src/gui/vector/qgsdiagramproperties.cpp @@ -422,7 +422,7 @@ void QgsDiagramProperties::insertDefaults() void QgsDiagramProperties::syncToLayer() { const QgsDiagramRenderer *renderer = mLayer->diagramRenderer(); - if ( renderer->rendererName() == QgsStackedDiagramRenderer::DIAGRAM_RENDERER_NAME_STACKED ) + if ( renderer && renderer->rendererName() == QgsStackedDiagramRenderer::DIAGRAM_RENDERER_NAME_STACKED ) { const QgsStackedDiagramRenderer *stackedRenderer = static_cast< const QgsStackedDiagramRenderer *>( renderer ); if ( stackedRenderer->rendererCount() > 0 )