From 893f122505d2d1086845403d052c3745626933f2 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 d4e6ab5a4591..3cf94e922326 100644 --- a/src/gui/vector/qgsdiagramproperties.cpp +++ b/src/gui/vector/qgsdiagramproperties.cpp @@ -421,7 +421,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 )