Qt: Fix battlechip crashes
Vicki Pfau vi@endrift.com
Tue, 26 Feb 2019 18:23:07 -0800
1 files changed,
4 insertions(+),
0 deletions(-)
M
src/platform/qt/BattleChipView.cpp
→
src/platform/qt/BattleChipView.cpp
@@ -46,6 +46,9 @@ connect(m_ui.chipId, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), m_ui.inserted, [this]() {
m_ui.inserted->setChecked(Qt::Unchecked); }); connect(m_ui.chipName, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), m_ui.chipId, [this](int id) { + if (id < 0) { + return; + } m_ui.chipId->setValue(m_model.chipNames().keys()[id]); });@@ -107,6 +110,7 @@
void BattleChipView::setFlavor(int flavor) { m_controller->setBattleChipFlavor(flavor); m_model.setFlavor(flavor); + m_ui.chipName->clear(); m_ui.chipName->addItems(m_model.chipNames().values()); }