mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-12-02 22:28:14 +00:00
[idd] helper: fix crash when saving invalid values
This commit is contained in:
@@ -178,9 +178,17 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
|
|||||||
|
|
||||||
int index = m_modeBox->getData(sel);
|
int index = m_modeBox->getData(sel);
|
||||||
auto &mode = index >= 0 ? (*m_modes)[index] : m_modes->emplace_back();
|
auto &mode = index >= 0 ? (*m_modes)[index] : m_modes->emplace_back();
|
||||||
mode.width = m_modeWidth->getNumericValue();
|
|
||||||
mode.height = m_modeHeight->getNumericValue();
|
try
|
||||||
mode.refresh = m_modeRefresh->getNumericValue();
|
{
|
||||||
|
mode.width = m_modeWidth->getNumericValue();
|
||||||
|
mode.height = m_modeHeight->getNumericValue();
|
||||||
|
mode.refresh = m_modeRefresh->getNumericValue();
|
||||||
|
}
|
||||||
|
catch (std::logic_error&)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
m_modeBox->delItem(sel);
|
m_modeBox->delItem(sel);
|
||||||
|
|||||||
Reference in New Issue
Block a user