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'); }