From c81c31acc31a0b73f577885eb76aa0f9e7e36cdc Mon Sep 17 00:00:00 2001 From: edisionnano Date: Wed, 16 Apr 2025 01:42:35 +0300 Subject: [PATCH] Don't show status if smart_status is null --- src/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 572dda0..b3d8e3b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -200,6 +200,7 @@ void MainWindow::updateUI() QJsonArray attributes = localObj["ata_smart_attributes"].toObject()["table"].toArray(); QString temperature = "-- °C"; + QJsonValue smartStatusValue = localObj.value("smart_status"); bool healthPassed = localObj["smart_status"].toObject()["passed"].toBool(); bool caution = false; bool bad = false; @@ -287,7 +288,7 @@ void MainWindow::updateUI() } else if (healthPassed && caution && !bad) { health = tr("Caution"); healthColor = cautionColor; - } else if ((bad || !healthPassed) && !modelName.isEmpty()){ + } else if ((bad || !healthPassed) && !modelName.isEmpty() && !smartStatusValue.isNull()){ health = tr("Bad"); healthColor = badColor; } else {