Commit c8e64303 authored by Volker Krause's avatar Volker Krause
Browse files

Be more tolerant to invalid GBFS feed list data

parent a986b702
...@@ -97,6 +97,9 @@ void GBFSJob::parseDiscoverData() ...@@ -97,6 +97,9 @@ void GBFSJob::parseDiscoverData()
if (data.size() == 1) { if (data.size() == 1) {
// only one set of feeds // only one set of feeds
m_feeds = data.begin().value().toObject().value(QLatin1String("feeds")).toArray(); m_feeds = data.begin().value().toObject().value(QLatin1String("feeds")).toArray();
if (m_feeds.isEmpty()) { // invalid format for single feeds
m_feeds = data.value(QLatin1String("feeds")).toArray();
}
} else if (!data.empty()) { } else if (!data.empty()) {
const auto localeLangs = QLocale().uiLanguages(); const auto localeLangs = QLocale().uiLanguages();
for (const auto &l : localeLangs) { for (const auto &l : localeLangs) {
......
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