From 4a172e40332afd782373665d1d4fcddee246910e Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Tue, 27 Oct 2026 23:58:59 -0400 Subject: [PATCH] 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 --- sdrgui/gui/basicchannelsettingsdialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdrgui/gui/basicchannelsettingsdialog.cpp b/sdrgui/gui/basicchannelsettingsdialog.cpp index b6660a0f7..ff73ff4ec 100644 --- a/sdrgui/gui/basicchannelsettingsdialog.cpp +++ b/sdrgui/gui/basicchannelsettingsdialog.cpp @@ -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);