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 nyalldawson committed Nov 29, 2024
1 parent f3f1f2c commit f28119f
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 @@ -982,6 +982,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 f28119f

Please sign in to comment.