diff --git a/webtools/mozbot/BotModules/Infobot.bm b/webtools/mozbot/BotModules/Infobot.bm index e081e8e86cbe..19b6598e53a5 100644 --- a/webtools/mozbot/BotModules/Infobot.bm +++ b/webtools/mozbot/BotModules/Infobot.bm @@ -263,13 +263,15 @@ sub SetFactoid { my($event, $replace, $subject, $database, $add, $object, $direct, $fromBot) = @_; if ($direct or $self->allowed($event, 'Learn')) { - teacher: if (@{$self->{'teachers'}}) { - foreach my $user (@{$self->{'teachers'}}) { - if ($user eq $event->{'userName'}) { - last teacher; + teacher: { + if (@{$self->{'teachers'}}) { + foreach my $user (@{$self->{'teachers'}}) { + if ($user eq $event->{'userName'}) { + last teacher; + } } + return 0; } - return 0; } # update the database