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

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