add another java client
[spider.git] / perl / IntMsg.pm
index 6e588b3ef7ddbb86c0165e229d37181c08179253..e3360fdbf566cf6990dda643c41a78953a3a65bd 100644 (file)
@@ -27,7 +27,7 @@ sub dequeue
 {
        my $conn = shift;
 
-       if ($conn->{msg} =~ /\n/) {
+       if ($conn && $conn->{msg} =~ /\n/) {
                my @lines = split /\r?\n/, $conn->{msg};
                if ($conn->{msg} =~ /\n$/) {
                        delete $conn->{msg};
@@ -41,7 +41,7 @@ sub dequeue
                        } else {
                                $_ = '';
                        }
-                       &{$conn->{rproc}}($conn, $_);
+                       &{$conn->{rproc}}($conn, $_) if exists $conn->{rproc};
                }
        }
 }