Skip to content

Commit

Permalink
Safety belt for null geoms
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Sep 20, 2021
1 parent c3b81d6 commit 641c05d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -4359,7 +4359,7 @@ static QVariant fcnProject( const QVariantList &values, const QgsExpressionConte
{
QgsGeometry geom = QgsExpressionUtils::getGeometry( values.at( 0 ), parent );

if ( QgsWkbTypes::flatType( geom.constGet()->simplifiedTypeRef( )->wkbType() ) != QgsWkbTypes::Type::Point )
if ( ! geom.constGet() || QgsWkbTypes::flatType( geom.constGet()->simplifiedTypeRef( )->wkbType() ) != QgsWkbTypes::Type::Point )
{
parent->setEvalErrorString( QStringLiteral( "'project' requires a point geometry" ) );
return QVariant();
Expand Down

0 comments on commit 641c05d

Please sign in to comment.