Merge pull request #16206 from Hinsbart/fix_empty_prop

ProjectSettings: Disallow adding properties without name.
This commit is contained in:
Rémi Verschelde 2018-01-31 17:23:27 +01:00 committed by GitHub
commit da187c875d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -750,7 +750,16 @@ void ProjectSettingsEditor::_item_add() {
String catname = category->get_text().strip_edges(); String catname = category->get_text().strip_edges();
String propname = property->get_text().strip_edges(); String propname = property->get_text().strip_edges();
String name = catname != "" ? catname + "/" + propname : propname;
if (propname.empty()) {
return;
}
if (catname.empty()) {
catname = "global";
}
String name = catname + "/" + propname;
undo_redo->create_action(TTR("Add Global Property")); undo_redo->create_action(TTR("Add Global Property"));