From aee98b805da8380658df62dcc01548dea461363f Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 23 Apr 2021 13:00:16 -0400 Subject: [PATCH] DnfContext: error out if no profile was found Missed this in #1200. --- libdnf/dnf-context.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libdnf/dnf-context.cpp b/libdnf/dnf-context.cpp index 0d8c3d915f..98b66e38f7 100644 --- a/libdnf/dnf-context.cpp +++ b/libdnf/dnf-context.cpp @@ -3480,6 +3480,9 @@ dnf_context_module_install(DnfContext * context, const char ** module_specs, GEr std::vector profiles; if (resolved_spec.first->getProfile() != "") { profiles = modpkg->getProfiles(resolved_spec.first->getProfile()); + if (profiles.empty()) { + throw std::runtime_error("No profile found matching " + resolved_spec.first->getProfile()); + } } else { profiles.push_back(modpkg->getDefaultProfile()); }