Skip to content

Commit

Permalink
Fix assert when trying to find a child node not yet populated
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Feb 21, 2025
1 parent ca3ce94 commit 885ea71
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/3d/qgspointcloudlayerchunkloader_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ static QgsChunkNode *findChunkNodeFromNodeId( QgsChunkNode *rootNode, QgsPointCl
QgsPointCloudNodeId p = parentIds.takeLast();
QgsChunkNodeId childNodeId( p.d(), p.x(), p.y(), p.z() );

if ( !chunk->hasChildrenPopulated() )
return nullptr;

QgsChunkNode *chunkChild = nullptr;
QgsChunkNode *const *children = chunk->children();
for ( int i = 0; i < chunk->childCount(); ++i )
Expand Down Expand Up @@ -287,9 +290,11 @@ QgsPointCloudLayerChunkedEntity::QgsPointCloudLayerChunkedEntity( Qgs3DMapSettin
mChunkUpdaterFactory.reset( new QgsChunkUpdaterFactory( mChunkLoaderFactory ) );

connect( pcl, &QgsPointCloudLayer::chunkAttributeValuesChanged, this, [this]( const QgsPointCloudNodeId &n ) {
QList<QgsChunkNode *> nodes;
nodes << findChunkNodeFromNodeId( mRootNode, n );
updateNodes( nodes, mChunkUpdaterFactory.get() );
QgsChunkNode *node = findChunkNodeFromNodeId( mRootNode, n );
if ( node )
{
updateNodes( QList<QgsChunkNode *>() << node, mChunkUpdaterFactory.get() );
}
} );
}
}
Expand Down

0 comments on commit 885ea71

Please sign in to comment.