Fix crash if no devices.

This commit is contained in:
srcejon 2024-04-06 22:33:54 +01:00
parent 035e6f59be
commit 44385832c3
1 changed files with 13 additions and 6 deletions

View File

@ -83,13 +83,20 @@ SIDAddChannelsDialog::~SIDAddChannelsDialog()
void SIDAddChannelsDialog::accept()
{
MainCore *mainCore = MainCore::instance();
connect(mainCore, &MainCore::channelAdded, this, &SIDAddChannelsDialog::channelAdded);
if (ui->channels->columnCount() > 2)
{
MainCore *mainCore = MainCore::instance();
connect(mainCore, &MainCore::channelAdded, this, &SIDAddChannelsDialog::channelAdded);
m_count = m_settings->m_channelSettings.size();
m_row = 0;
m_col = COL_DEVICE;
addNextChannel();
m_count = m_settings->m_channelSettings.size();
m_row = 0;
m_col = COL_DEVICE;
addNextChannel();
}
else
{
QDialog::accept();
}
}
void SIDAddChannelsDialog::addNextChannel()