From: Bill Erickson Date: Wed, 14 Mar 2012 15:38:18 +0000 (-0400) Subject: Prevent undef warnings on perl socket read nbytes test X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=582ed4757bda3f9e4aa5d2098be28b0d554501b4;p=working%2FOpenSRF.git Prevent undef warnings on perl socket read nbytes test Signed-off-by: Bill Erickson --- diff --git a/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm b/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm index b8a5da1..b68e418 100644 --- a/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm +++ b/src/perl/lib/OpenSRF/Transport/SlimJabber/XMPPReader.pm @@ -226,7 +226,7 @@ sub wait { $first_read = 0; } - if ($nbytes == 0 and $first_read) { + if ($first_read and defined $nbytes and $nbytes == 0) { # if the first read on an active socket is 0 bytes, # the socket has been disconnected from the remote end. $logger->error("Disconnected from Jabber server");