Do not try to dereference m_viewStep if it's invalid

This commit is contained in:
Aurélien Gâteau 2014-08-09 09:10:26 +02:00
parent 738427130b
commit df89a391c4

View File

@ -51,17 +51,15 @@ ViewModule::loadSelf()
if ( m_loader ) if ( m_loader )
{ {
m_viewStep = qobject_cast< ViewStep* >( m_loader->instance() ); m_viewStep = qobject_cast< ViewStep* >( m_loader->instance() );
m_viewStep->setConfigurationMap( m_configurationMap ); if ( !m_viewStep )
if ( m_viewStep )
{ {
cLog() << Q_FUNC_INFO << m_loader->errorString();
return;
}
m_viewStep->setConfigurationMap( m_configurationMap );
ViewManager::instance()->addViewStep( m_viewStep ); ViewManager::instance()->addViewStep( m_viewStep );
m_loaded = true; m_loaded = true;
} }
else
{
cDebug() << Q_FUNC_INFO << m_loader->errorString();
}
}
} }