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

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