Removed assert()s in ConfigItemBuilder::Compile.

This commit is contained in:
Gunnar Beutner 2013-02-01 14:45:55 +01:00
parent 0ca8012079
commit 6c0a6a2207
1 changed files with 11 additions and 2 deletions

View File

@ -82,8 +82,17 @@ void ConfigItemBuilder::AddExpressionList(const ExpressionList::Ptr& exprl)
ConfigItem::Ptr ConfigItemBuilder::Compile(void)
{
assert(!m_Type.IsEmpty());
assert(!m_Name.IsEmpty());
if (m_Type.IsEmpty()) {
stringstream msgbuf;
msgbuf << "The type name of an object may not be empty: " << m_DebugInfo;
throw_exception(invalid_argument(msgbuf.str()));
}
if (m_Name.IsEmpty()) {
stringstream msgbuf;
msgbuf << "The name of an object may not be empty: " << m_DebugInfo;
throw_exception(invalid_argument(msgbuf.str()));
}
ExpressionList::Ptr exprl = boost::make_shared<ExpressionList>();