From 92d8b421c21208fcb89e0cb0b7e0d5818d8a2dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Tue, 17 Dec 2024 13:33:57 +0000 Subject: [PATCH] fix: groupInfo: don't attempt to (and fail) display the guest list when account doesn't have access to it --- bin/plugin/open/groupInfo | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/plugin/open/groupInfo b/bin/plugin/open/groupInfo index 6182eac..01554a4 100755 --- a/bin/plugin/open/groupInfo +++ b/bin/plugin/open/groupInfo @@ -253,14 +253,15 @@ sub print_group_info { if $ret{'members'}; # show guest info, along with the number of accesses each guest has - my @guest_text; - foreach my $guest (@{$ret{'guests'}}) { - my $nb = $ret{'guests_accesses'}{$guest}; - push @guest_text, sprintf("%s[%s]", $guest, $nb // '?'); + if ($ret{'guests'}) { + my @guest_text; + foreach my $guest (@{$ret{'guests'}}) { + my $nb = $ret{'guests_accesses'}{$guest}; + push @guest_text, sprintf("%s[%s]", $guest, $nb // '?'); + } + osh_info("Group ${groupName}'s Guests (with access to SOME of the group servers) are: " + . colored(@{$ret{'guests'}} ? join(" ", sort @guest_text) : '-', 'red')); } - osh_info("Group ${groupName}'s Guests (with access to SOME of the group servers) are: " - . colored(@{$ret{'guests'}} ? join(" ", sort @guest_text) : '-', 'red')) - if $ret{'guests'}; # current user doesn't have enough rights to get this info, tell them that if (!$ret{'members'}) {