From 409e1f1a0018a1a6b0a9a24f8bdfdb71099c43d7 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Mon, 20 Jul 2026 23:20:15 -0400 Subject: [PATCH] Remove redundant ui null check in MeshcoreDemodGUI & MeshtasticDemodGUI The ui object is created during MeshcoreDemodGUI and MeshtasticDemodGUI construction and remains valid for the lifetime of the widget. Remove the unnecessary null check to avoid misleading static analysis tools into assuming ui can be null. This resolves a Coverity false positive where the later call to updateDechirpModeUI() was reported as a possible null dereference in both places. Signed-off-by: Robin Getz --- plugins/channelrx/demodmeshcore/meshcoredemodgui.cpp | 2 +- plugins/channelrx/demodmeshtastic/meshtasticdemodgui.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/channelrx/demodmeshcore/meshcoredemodgui.cpp b/plugins/channelrx/demodmeshcore/meshcoredemodgui.cpp index a095c8dab..9909be6e2 100644 --- a/plugins/channelrx/demodmeshcore/meshcoredemodgui.cpp +++ b/plugins/channelrx/demodmeshcore/meshcoredemodgui.cpp @@ -2350,7 +2350,7 @@ void MeshcoreDemodGUI::setDechirpInspectionMode(bool enabled) { m_dechirpSelectedMessageKey.clear(); - if (m_spectrumVis && ui && ui->glSpectrum) + if (m_spectrumVis && ui->glSpectrum) { m_spectrumVis->setGLSpectrum(ui->glSpectrum); diff --git a/plugins/channelrx/demodmeshtastic/meshtasticdemodgui.cpp b/plugins/channelrx/demodmeshtastic/meshtasticdemodgui.cpp index 56af1630f..d2e8f3531 100644 --- a/plugins/channelrx/demodmeshtastic/meshtasticdemodgui.cpp +++ b/plugins/channelrx/demodmeshtastic/meshtasticdemodgui.cpp @@ -2350,7 +2350,7 @@ void MeshtasticDemodGUI::setDechirpInspectionMode(bool enabled) { m_dechirpSelectedMessageKey.clear(); - if (m_spectrumVis && ui && ui->glSpectrum) + if (m_spectrumVis && ui->glSpectrum) { m_spectrumVis->setGLSpectrum(ui->glSpectrum);