diff --git a/src/distribution.cpp b/src/distribution.cpp
index 8db1869..ba48c54 100644
--- a/src/distribution.cpp
+++ b/src/distribution.cpp
@@ -14,6 +14,7 @@
// along with this program. If not, see .
#include "distribution.h"
+#include "distro_series.h"
#include
#include
@@ -25,15 +26,15 @@ distribution::distribution()
summary(""),
domain_name(""),
lp(nullptr),
- current_series([this]() -> std::optional {
- if (current_series_link.empty()) return std::nullopt;
+ current_series([this]() -> std::optional<::distro_series> {
+ if (!lp || current_series_link.empty()) return std::nullopt;
if (_current_series) return _current_series;
auto response = lp ? lp->api_get(current_series_link) : std::nullopt;
if (!response) return std::nullopt;
auto data = nlohmann::json::parse(response.value());
- auto ds = distro_series::parse(data.dump());
+ auto ds = ::distro_series::parse(data.dump());
if (ds) {
ds->set_lp(lp);
diff --git a/src/distribution.h b/src/distribution.h
index e5c5da7..741d106 100644
--- a/src/distribution.h
+++ b/src/distribution.h
@@ -69,14 +69,15 @@ public:
std::string valid_specifications_collection_link;
std::string vulnerabilities_collection_link;
std::string webhooks_collection_link;
-
- lazy_optional()>> current_series;
private:
launchpad* lp;
std::optional _current_series = std::nullopt;
// JSON parsing utility
void parse_json(const std::string& json_data);
+
+public:
+ lazy_optional()>> current_series;
};
#endif // DISTRIBUTION_H