diff --git a/src/core/pointcloud/qgspointcloudstatscalculator.cpp b/src/core/pointcloud/qgspointcloudstatscalculator.cpp index 86f13c064f70..4cdf9388b1f0 100644 --- a/src/core/pointcloud/qgspointcloudstatscalculator.cpp +++ b/src/core/pointcloud/qgspointcloudstatscalculator.cpp @@ -70,6 +70,11 @@ struct StatsProcessor else { QgsPointCloudBlockRequest *request = mIndex->asyncNodeData( node, mRequest ); + if ( request == nullptr ) + { + QgsDebugError( QStringLiteral( "Unable to calculate statistics for node %1: Got nullptr async request" ).arg( node.toString() ) ); + return QgsPointCloudStatistics(); + } QEventLoop loop; QObject::connect( request, &QgsPointCloudBlockRequest::finished, &loop, &QEventLoop::quit ); QObject::connect( mFeedback, &QgsFeedback::canceled, &loop, &QEventLoop::quit );