Commit 01a92d4e authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[dataengines/weather/dwd] Properly detect empty reply

The reply may be non-null but empty, which leads to a crash later

BUG: 457606
parent 669b2587
......@@ -282,7 +282,7 @@ void DWDIon::setup_slotJobFinished(KJob *job)
setData(QStringLiteral("dwd|validate|") + searchText, Data());
QByteArray catalogueData = m_searchJobData[job];
if (!catalogueData.isNull()) {
if (!catalogueData.isEmpty()) {
parseStationData(catalogueData);
searchInStationList(searchText);
}
......@@ -299,7 +299,7 @@ void DWDIon::measure_slotJobFinished(KJob *job)
QJsonDocument doc = QJsonDocument::fromJson(m_measureJobJSON.value(job));
// Not all stations have current measurements
if (!doc.isNull()) {
if (!doc.isEmpty()) {
parseMeasureData(source, doc);
} else {
m_weatherData[source].isMeasureDataPending = false;
......@@ -317,7 +317,7 @@ void DWDIon::forecast_slotJobFinished(KJob *job)
QJsonDocument doc = QJsonDocument::fromJson(m_forecastJobJSON.value(job));
if (!doc.isNull()) {
if (!doc.isEmpty()) {
parseForecastData(source, doc);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment