From ef072602fa594ca670326caf6868fe513aaad356 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 7 Jun 2020 00:12:09 -0700 Subject: [PATCH] Factoids: test enabled for definedness --- PBot/Factoids.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 641d2c32..c691e4c2 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -1284,7 +1284,9 @@ sub handle_action { $self->{pbot}->{logger} ->log("(" . (defined $context->{from} ? $context->{from} : "(undef)") . "): $context->{nick}!$context->{user}\@$context->{host}: $trigger_name: action: \"$action\"\n"); - if ($self->{factoids}->get_data($channel, $keyword, 'enabled') == 0) { + my $enabled = $self->{factoids}->get_data($channel, $keyword, 'enabled'); + + if (defined $enabled and $enabled == 0) { $self->{pbot}->{logger}->log("$trigger_name disabled.\n"); return "/msg $context->{nick} ${ref_from}$trigger_name is currently disabled."; }