diff --git a/sdrgui/gui/channeladddialog.cpp b/sdrgui/gui/channeladddialog.cpp index a9b7138ac..1c40efb5e 100644 --- a/sdrgui/gui/channeladddialog.cpp +++ b/sdrgui/gui/channeladddialog.cpp @@ -46,7 +46,7 @@ void ChannelAddDialog::addChannelNames(const QStringList& channelNames) void ChannelAddDialog::apply(QAbstractButton *button) { - if (button == (QAbstractButton*) ui->buttonBox->button(QDialogButtonBox::Apply)) + if ((ui->channelSelect->count() > 0) && (button == (QAbstractButton*) ui->buttonBox->button(QDialogButtonBox::Apply))) { int selectedChannelIndex = ui->channelSelect->currentIndex(); emit(addChannel(selectedChannelIndex)); diff --git a/sdrgui/gui/featureadddialog.cpp b/sdrgui/gui/featureadddialog.cpp index 798791a3b..709490053 100644 --- a/sdrgui/gui/featureadddialog.cpp +++ b/sdrgui/gui/featureadddialog.cpp @@ -46,7 +46,7 @@ void FeatureAddDialog::addFeatureNames(const QStringList& featureNames) void FeatureAddDialog::apply(QAbstractButton *button) { - if (button == (QAbstractButton*) ui->buttonBox->button(QDialogButtonBox::Apply)) + if ((ui->featureSelect->count() > 0) && (button == (QAbstractButton*) ui->buttonBox->button(QDialogButtonBox::Apply))) { int selectedFeatureIndex = ui->featureSelect->currentIndex(); emit(addFeature(selectedFeatureIndex));