don't screw up on messages with no target_name in hints master
Matt S Trout [Fri, 18 Feb 2011 19:18:16 +0000 (19:18 +0000)]
lib/App/Clifton/Tower/IRC.pm

index ccba44c..fbfef64 100644 (file)
@@ -63,9 +63,9 @@ sub send_irc_message {
 sub receive_irc_message {
   my ($self, $message, $hints) = @_;
   return if $hints->{prefix_is_me};
-  if (my $chain = $self->chains->{$hints->{target_name}}) {
+  if (my $chain = $self->chains->{$hints->{target_name}||''}) {
     $chain->handle_irc_message($message, $hints);
-  } elsif ($chain = $self->chains->{$hints->{targets}}) {
+  } elsif ($chain = $self->chains->{$hints->{targets}||''}) {
     $chain->handle_irc_message($message, $hints);
   }
 }