Make sure that object names aren't empty

fixes #9989
This commit is contained in:
Gunnar Beutner 2016-05-11 09:48:18 +02:00
parent 48ea8800c3
commit bd896935d6
1 changed files with 3 additions and 0 deletions

View File

@ -219,6 +219,9 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard)
NameComposer *nc = dynamic_cast<NameComposer *>(type.get()); NameComposer *nc = dynamic_cast<NameComposer *>(type.get());
if (nc) { if (nc) {
if (name.IsEmpty())
BOOST_THROW_EXCEPTION(ScriptError("Object name must not be empty.", m_DebugInfo));
name = nc->MakeName(name, dobj); name = nc->MakeName(name, dobj);
if (name.IsEmpty()) if (name.IsEmpty())