[libcalamaresui] Avoid nullptr deref

- there's a check already there, and probably this means things are hopelessly
  broken anyway, but let's not crash here.
main
Adriaan de Groot 5 years ago
parent 4a6ee39f8b
commit 347a25d13d

@ -128,15 +128,19 @@ ViewManager::insertViewStep( int before, ViewStep* step )
{
cError() << "ViewStep" << step->moduleInstanceKey() << "has no widget.";
}
QLayout* layout = step->widget()->layout();
if ( layout )
else
{
layout->setContentsMargins( 0, 0, 0, 0 );
// step->adjustMargins() "some magic"
QLayout* layout = step->widget()->layout();
if ( layout )
{
layout->setContentsMargins( 0, 0, 0, 0 );
}
m_stack->insertWidget( before, step->widget() );
m_stack->setCurrentIndex( 0 );
step->widget()->setFocus();
}
m_stack->insertWidget( before, step->widget() );
m_stack->setCurrentIndex( 0 );
step->widget()->setFocus();
emit endInsertRows();
}

Loading…
Cancel
Save