Skip to content

Commit

Permalink
fix(elevationprofilecanvas): avoid crash on segfault
Browse files Browse the repository at this point in the history
If no profile curve is set and regenerateResultsForLayer is run
(triggered by adding a feature in a layer for instance), then QGIS
crashes.
  • Loading branch information
Djedouas authored and github-actions[bot] committed Nov 28, 2024
1 parent 0e03cc6 commit 643a67d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/elevation/qgselevationprofilecanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,9 @@ void QgsElevationProfileCanvas::onLayerProfileRendererPropertyChanged()

void QgsElevationProfileCanvas::regenerateResultsForLayer()
{
if ( !mCurrentJob )
return;

if ( QgsMapLayer *layer = qobject_cast< QgsMapLayer * >( sender() ) )
{
if ( QgsAbstractProfileSource *source = dynamic_cast< QgsAbstractProfileSource * >( layer ) )
Expand Down

0 comments on commit 643a67d

Please sign in to comment.