From 13ba98eb8a97873c80779df7587a3253028b9c1f Mon Sep 17 00:00:00 2001 From: srcejon Date: Thu, 28 Mar 2024 15:28:02 +0000 Subject: [PATCH] Sat Tracker: Prevent crash if satellite not found. --- .../feature/satellitetracker/satelliteselectiondialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/feature/satellitetracker/satelliteselectiondialog.cpp b/plugins/feature/satellitetracker/satelliteselectiondialog.cpp index 3184be204..73751a8f2 100644 --- a/plugins/feature/satellitetracker/satelliteselectiondialog.cpp +++ b/plugins/feature/satellitetracker/satelliteselectiondialog.cpp @@ -197,6 +197,13 @@ void SatelliteSelectionDialog::displaySatInfo(const QString& name) { SatNogsSatellite *sat = m_satellites[name]; m_satInfo = sat; + if (!sat) + { + // Might not be null if satellite name entered via API + ui->satInfo->setText(""); + ui->satImage->setPixmap(QPixmap()); + return; + } QStringList info; info.append(QString("Name: %1").arg(sat->m_name)); if (sat->m_names.size() > 0)