Blame SOURCES/0041-Fix-listing-a-repository-without-cpeid-RhBug-2066334.patch

4f31a3
From 3a3929a27734aa77c980610a43039cb6b2b6d658 Mon Sep 17 00:00:00 2001
4f31a3
From: Jan Kolarik <jkolarik@redhat.com>
4f31a3
Date: Wed, 10 Aug 2022 05:21:38 +0000
4f31a3
Subject: [PATCH] Fix listing a repository without cpeid (RhBug:2066334)
4f31a3
4f31a3
= changelog =
4f31a3
type: bugfix
4f31a3
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2066334
4f31a3
---
4f31a3
 libdnf/repo/Repo.cpp | 9 +++++++--
4f31a3
 1 file changed, 7 insertions(+), 2 deletions(-)
4f31a3
4f31a3
diff --git a/libdnf/repo/Repo.cpp b/libdnf/repo/Repo.cpp
4f31a3
index e3a574fb..d61a24a5 100644
4f31a3
--- a/libdnf/repo/Repo.cpp
4f31a3
+++ b/libdnf/repo/Repo.cpp
4f31a3
@@ -1021,8 +1021,13 @@ bool Repo::Impl::loadCache(bool throwExcept, bool ignoreMissing)
4f31a3
     for (auto elem = yum_repomd->distro_tags; elem; elem = g_slist_next(elem)) {
4f31a3
         if (elem->data) {
4f31a3
             auto distroTag = static_cast<LrYumDistroTag *>(elem->data);
4f31a3
-            if (distroTag->tag)
4f31a3
-                distro_tags.emplace_back(distroTag->cpeid, distroTag->tag);
4f31a3
+            if (distroTag->tag) {
4f31a3
+                std::string cpeid_str;
4f31a3
+                if (distroTag->cpeid) {
4f31a3
+                    cpeid_str = distroTag->cpeid;
4f31a3
+                }
4f31a3
+                distro_tags.emplace_back(std::move(cpeid_str), distroTag->tag);
4f31a3
+            }
4f31a3
         }
4f31a3
     }
4f31a3
 
4f31a3
-- 
4f31a3
2.37.1
4f31a3