Skip to content

Commit

Permalink
[3d] Fix crash in terrain generator if DEM raster layer is missing
Browse files Browse the repository at this point in the history
(cherry picked from commit 685806b)
  • Loading branch information
wonder-sk authored and nyalldawson committed Nov 6, 2018
1 parent bacbcf6 commit 1db7a29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/3d/terrain/qgsdemterraingenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ QgsRectangle QgsDemTerrainGenerator::extent() const
float QgsDemTerrainGenerator::heightAt( double x, double y, const Qgs3DMapSettings &map ) const
{
Q_UNUSED( map );
return mHeightMapGenerator->heightAt( x, y );
if ( mHeightMapGenerator )
return mHeightMapGenerator->heightAt( x, y );
else
return 0;
}

void QgsDemTerrainGenerator::writeXml( QDomElement &elem ) const
Expand Down

0 comments on commit 1db7a29

Please sign in to comment.