From a11f8aaa4fbdf408905e64bb040038c87d33d840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Carrillo?= Date: Tue, 5 Nov 2024 16:38:42 -0500 Subject: [PATCH] [fix] When switching diagram type from none to any other one, check nullptr renderer when syncing to layer --- src/gui/vector/qgsdiagramproperties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 )