modulecmd: use of unset variable fixed

This commit is contained in:
2024-08-21 10:48:22 +02:00
parent 10c6922f8a
commit fefe313d51
+2
View File
@@ -1993,6 +1993,7 @@ subcommand_unuse() {
"${arg}" "${arg}"
fi fi
if [[ -v PMODULES_LOADED_${arg^^} ]]; then
local var="PMODULES_LOADED_${arg^^}" local var="PMODULES_LOADED_${arg^^}"
if [[ -n "${!var}" ]]; then if [[ -n "${!var}" ]]; then
std::die 3 "%s %s: %s -- %s" \ std::die 3 "%s %s: %s -- %s" \
@@ -2000,6 +2001,7 @@ subcommand_unuse() {
"cannot remove group due to loaded modules" \ "cannot remove group due to loaded modules" \
"${arg}" "${arg}"
fi fi
fi
std::remove_path UsedGroups "${arg}" std::remove_path UsedGroups "${arg}"
local overlay local overlay
for overlay in "${UsedOverlays[@]}"; do for overlay in "${UsedOverlays[@]}"; do