diff --git a/PBot/BanList.pm b/PBot/BanList.pm index 5323ff07..a0b76996 100644 --- a/PBot/BanList.pm +++ b/PBot/BanList.pm @@ -277,8 +277,8 @@ sub track_mode { my ($source, $channel, $mode, $mask) = @_; my ($nick) = $source =~ /(^[^!]+)/; - $channel = lc $channel; - $mask = lc $mask; + $channel = defined $channel ? lc $channel : ''; + $mask = defined $mask ? lc $mask : ''; my $mute_char = $self->{pbot}->{registry}->get_value('banlist', 'mute_mode_char'); diff --git a/PBot/ChanOps.pm b/PBot/ChanOps.pm index d24c91a9..4c809493 100644 --- a/PBot/ChanOps.pm +++ b/PBot/ChanOps.pm @@ -35,8 +35,8 @@ sub initialize { sub track_mode { my ($self, $source, $channel, $mode, $target) = @_; - $channel = lc $channel; - $target = lc $target; + $channel = defined $channel ? lc $channel : ''; + $target = defined $target ? lc $target : ''; if ($target eq lc $self->{pbot}->{registry}->get_value('irc', 'botnick')) { if ($mode eq '+o') {