Skip to content

Commit c255823

Browse files
committed
Sanity checks in add attribute dialog
1 parent 302b2ae commit c255823

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/app/qgsaddattrdialog.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ void QgsAddAttrDialog::accept()
113113
tr( "Invalid field name. This field name is reserved and cannot be used." ) );
114114
return;
115115
}
116+
if ( mNameEdit->text().isEmpty() )
117+
{
118+
QMessageBox::warning( this, tr( "Warning" ),
119+
tr( "No name specified. Please specify a name to create a new field." ) );
120+
return;
121+
}
122+
if ( mButtonVirtualField->isChecked() && mExpressionWidget->currentField().isEmpty() )
123+
{
124+
QMessageBox::warning( this, tr( "Warning" ),
125+
tr( "No expression specified. Please enter an expression that will be used to calculate the field values." ) );
126+
return;
127+
}
116128
QDialog::accept();
117129
}
118130

0 commit comments

Comments
 (0)