From 9ec2622183da1a584514c358195df3e172e77411 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 11 Jun 2020 19:30:07 -0700 Subject: [PATCH] Ensure params to track_mode are defined --- PBot/BanList.pm | 4 ++-- PBot/ChanOps.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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') {