Skip to content

Commit

Permalink
add another check
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec authored and github-actions[bot] committed Jan 21, 2023
1 parent e104f1b commit abcbd52
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/mesh/qgsmesheditor.cpp
Expand Up @@ -308,7 +308,10 @@ bool QgsMeshEditor::faceCanBeAdded( const QgsMeshFace &face ) const
bool QgsMeshEditor::faceCanBeAddedWithNewVertices( const QList<int> &verticesIndex, const QList<QgsMeshVertex> &newVertices ) const
{
QgsMeshEditingError error;
QList<int> face = prepareFaceWithNewVertices( verticesIndex, newVertices, error );
const QList<int> face = prepareFaceWithNewVertices( verticesIndex, newVertices, error );

if ( face.isEmpty() )
return false;

if ( error.errorType != Qgis::MeshEditingErrorType::NoError )
return false;
Expand Down Expand Up @@ -714,6 +717,8 @@ QList<int> QgsMeshEditor::prepareFaceWithNewVertices( const QList<int> &face, co
{
if ( face.at( i ) == -1 )
{
if ( newVertexPos >= newVertices.count() )
return QList<int>();
vertices[i] = newVertices.at( newVertexPos++ );
}
else if ( face.at( i ) >= 0 )
Expand Down

0 comments on commit abcbd52

Please sign in to comment.