diff --git a/src/source_package_publishing_history.cpp b/src/source_package_publishing_history.cpp index d666679..ab0e3be 100644 --- a/src/source_package_publishing_history.cpp +++ b/src/source_package_publishing_history.cpp @@ -29,7 +29,7 @@ source_package_publishing_history::source_package_publishing_history() lp(nullptr), _distro_series(std::nullopt), distro_series([this]() -> std::optional<::distro_series> { - if (distro_series_link.empty()) return std::nullopt; + if (!lp || distro_series_link.empty()) return std::nullopt; if (_distro_series) return _distro_series; auto response = lp ? lp->api_get(distro_series_link) : std::nullopt; diff --git a/src/source_package_publishing_history.h b/src/source_package_publishing_history.h index 8fa2be7..431a385 100644 --- a/src/source_package_publishing_history.h +++ b/src/source_package_publishing_history.h @@ -53,12 +53,14 @@ public: std::string source_package_name; std::string source_package_version; - void set_lp(launchpad* lp_ptr); - lazy_optional<::distro_series, std::function()>> distro_series; - private: launchpad* lp; std::optional<::distro_series> _distro_series = std::nullopt; + +public: + void set_lp(launchpad* lp_ptr); + lazy_optional<::distro_series, std::function()>> distro_series; + }; #endif // SOURCE_PACKAGE_PUBLISHING_HISTORY