Make sure selected call exists before using it

This commit is contained in:
Jordan Sherer 2018-07-21 02:31:30 -04:00
parent fe405cfba8
commit e955cff24f

View File

@ -6884,9 +6884,11 @@ void MainWindow::on_snrMacroButton_clicked(){
auto items = ui->tableWidgetCalls->selectedItems();
if(!items.isEmpty()){
QString selectedCall = items.first()->text();
int snr = m_callActivity[selectedCall].snr;
addMessageText(Varicode::formatSNR(snr));
return;
if(m_callActivity.contains(selectedCall)){
int snr = m_callActivity[selectedCall].snr;
addMessageText(Varicode::formatSNR(snr));
return;
}
}
int offset = currentFreq();