Browse Source

sdrgui/gui: Guard against missing channel in preset dialog

Check that getChannel() returns a valid channel before
accessing its URI or opening the presets dialog. Log a
debug message and return if the channel is unavailable.
Identified by Coverity CID 652402.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.1.0
Robin Getz 4 weeks ago
parent
commit
4a172e4033
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 5
      sdrgui/gui/basicchannelsettingsdialog.cpp

5
sdrgui/gui/basicchannelsettingsdialog.cpp

@ -187,6 +187,11 @@ void BasicChannelSettingsDialog::on_presets_clicked() @@ -187,6 +187,11 @@ void BasicChannelSettingsDialog::on_presets_clicked()
return;
}
ChannelAPI *channel = MainCore::instance()->getChannel(channelGUI->getDeviceSetIndex(), channelGUI->getIndex());
if (!channel)
{
qDebug() << "BasicChannelSettingsDialog::on_presets_clicked: not a valid channel";
return;
}
const QString& id = channel->getURI();
PluginPresetsDialog dialog(id);

Loading…
Cancel
Save