Permalink
Browse files

Fixed crashing on unknown event (fallous)

  • Loading branch information...
1 parent f6f77be commit a6195a2a16764b31f01f8cc9a6b939f2fbc3006c @vti committed Mar 15, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 lib/PocketIO/Connection.pm
  2. +3 −1 t/conn/parsing.t
@@ -296,7 +296,7 @@ sub parse_message {
$self->write($message);
}
- );
+ ) if defined $self->{socket}->on($name);
}
elsif ($message->type eq 'heartbeat') {
View
@@ -3,7 +3,7 @@ use warnings;
use utf8;
use Encode;
-use Test::More tests => 6;
+use Test::More tests => 7;
use_ok('PocketIO::Connection');
@@ -24,3 +24,5 @@ is_deeply $output => {foo => 'bar'};
$conn->parse_message('4:1::{"foo":"' . encode_utf8('привет') . '"}');
is_deeply $output => {foo => 'привет'};
+
+ok $conn->parse_message('5:1::{"args":["foo"],"name":"foo"}');

0 comments on commit a6195a2

Please sign in to comment.