diff --git a/src/3d/terrain/qgsdemterraingenerator.cpp b/src/3d/terrain/qgsdemterraingenerator.cpp index 91e93a5333cb..2b60cb854ed9 100644 --- a/src/3d/terrain/qgsdemterraingenerator.cpp +++ b/src/3d/terrain/qgsdemterraingenerator.cpp @@ -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