From e955cff24f26035027007ab25383f63bd53a3275 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Sat, 21 Jul 2018 02:31:30 -0400 Subject: [PATCH] Make sure selected call exists before using it --- mainwindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index eef235f..1191aed 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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();