1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Minor clean-ups.

This commit is contained in:
jules 2013-08-21 21:03:31 +01:00
parent 9a1171a7ef
commit da3838db8a
4 changed files with 17 additions and 12 deletions

View file

@ -131,10 +131,11 @@ Component* ComponentBuilder::createComponent()
{
jassert (types.size() > 0); // You need to register all the necessary types before you can load a component!
TypeHandler* const type = getHandlerForState (state);
jassert (type != nullptr); // trying to create a component from an unknown type of ValueTree
if (TypeHandler* const type = getHandlerForState (state))
return ComponentBuilderHelpers::createNewComponent (*type, state, nullptr);
return type != nullptr ? ComponentBuilderHelpers::createNewComponent (*type, state, nullptr) : nullptr;
jassertfalse; // trying to create a component from an unknown type of ValueTree
return nullptr;
}
void ComponentBuilder::registerTypeHandler (ComponentBuilder::TypeHandler* const type)