mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
throw exception when trying to add same field name
This commit is contained in:
parent
e79b3e18c5
commit
fe34c45192
@ -120,8 +120,7 @@ bool QgsAddIncrementalFieldAlgorithm::prepareAlgorithm( const QVariantMap ¶m
|
||||
|
||||
if ( source->fields().lookupField( mFieldName ) >= 0 )
|
||||
{
|
||||
feedback->reportError( QObject::tr( "Field with the same name already exists" ) );
|
||||
return false;
|
||||
throw QgsProcessingException( QObject::tr( "Field with the same name already exists" ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -131,8 +131,7 @@ bool QgsAddTableFieldAlgorithm::prepareAlgorithm( const QVariantMap ¶meters,
|
||||
|
||||
if ( source->fields().lookupField( name ) >= 0 )
|
||||
{
|
||||
feedback->reportError( QObject::tr( "Field with the same name already exists" ) );
|
||||
return false;
|
||||
throw QgsProcessingException( QObject::tr( "Field with the same name already exists" ) );
|
||||
}
|
||||
|
||||
mField.setName( name );
|
||||
|
Loading…
x
Reference in New Issue
Block a user