From 3c3e642bb9eabcbc18235cbeba0c9c72b565c5c7 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 9 Feb 2020 20:16:29 -0800 Subject: [PATCH] Users: fix undefined value warning --- PBot/Users.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PBot/Users.pm b/PBot/Users.pm index 12703ca7..bdf2f7a0 100644 --- a/PBot/Users.pm +++ b/PBot/Users.pm @@ -446,7 +446,7 @@ sub userset { return "To modify admin user accounts your user account must have the can-modify-admins capability."; } - if ($self->{pbot}->{capabilities}->exists($key) and not $self->{pbot}->{capabilities}->userhas($u, $key)) { + if (defined $key and $self->{pbot}->{capabilities}->exists($key) and not $self->{pbot}->{capabilities}->userhas($u, $key)) { return "To set the $key capability your user account must also have it." unless $self->{pbot}->{capabilities}->userhas($u, 'botowner'); }