core: (fixes #1049) add error message to ObjectFactory::Create
This commit is contained in:
committed by
Tommaso Pecorella
parent
3f5d421fe7
commit
b0696dd8fe
@@ -205,7 +205,11 @@ Ptr<T>
|
||||
ObjectFactory::Create() const
|
||||
{
|
||||
Ptr<Object> object = Create();
|
||||
return object->GetObject<T>();
|
||||
auto obj = object->GetObject<T>();
|
||||
NS_ASSERT_MSG(obj != nullptr,
|
||||
"ObjectFactory::Create error: incompatible types ("
|
||||
<< T::GetTypeId().GetName() << " and " << object->GetInstanceTypeId() << ")");
|
||||
return obj;
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
|
||||
Reference in New Issue
Block a user