Crash dump related, check getMappingComponent

This commit is contained in:
Klaus Basan
2018-10-14 01:53:10 +02:00
parent 1fbe914cdc
commit 5e070f1f8c

View File

@@ -94,12 +94,16 @@ namespace BlackGui
void CDbOwnModelSetFormDialog::simulatorChanged(const CSimulatorInfo &simulator) void CDbOwnModelSetFormDialog::simulatorChanged(const CSimulatorInfo &simulator)
{ {
Q_ASSERT_X(this->getMappingComponent(), Q_FUNC_INFO, "missing mapping component");
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator"); Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator");
this->setSimulator(simulator); this->setSimulator(simulator);
this->getMappingComponent()->setOwnModelsSimulator(simulator);
this->getMappingComponent()->setOwnModelSetSimulator(simulator); // if possible set in mappings component
this->checkData(); if (this->getMappingComponent())
{
this->getMappingComponent()->setOwnModelsSimulator(simulator);
this->getMappingComponent()->setOwnModelSetSimulator(simulator);
this->checkData();
}
} }
bool CDbOwnModelSetFormDialog::checkData() bool CDbOwnModelSetFormDialog::checkData()
@@ -109,7 +113,7 @@ namespace BlackGui
const int c = this->getMappingComponent()->getOwnModelsCount(); const int c = this->getMappingComponent()->getOwnModelsCount();
if (c < 1) if (c < 1)
{ {
const CStatusMessage m = CStatusMessage(this).error("No models for %1") << m_simulatorInfo.toQString(true); const CStatusMessage m = CStatusMessage(this).error("No models for '%1'") << m_simulatorInfo.toQString(true);
ui->form_OwnModelSet->showOverlayMessage(m); ui->form_OwnModelSet->showOverlayMessage(m);
return false; return false;
} }