From: erickson Date: Wed, 30 Aug 2006 15:23:24 +0000 (+0000) Subject: added var check to prevent warnings on the numerous timed_read(0) calls X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3b14c144c4e85d28f4f0dfe78261b16aa78780b0;p=working%2FOpenSRF.git added var check to prevent warnings on the numerous timed_read(0) calls git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@772 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm b/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm index d67e77d..77daf79 100644 --- a/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm +++ b/src/perlmods/OpenSRF/Transport/SlimJabber/Client.pm @@ -566,19 +566,21 @@ sub process { } my $t = $self->{last_tag}; - my @msgs = $val =~ /(<$t[^>]*>.*?<\/$t>)/g; - $val = shift(@msgs); - if (@msgs) { - my $tmp = $self->{temp_buffer}; - - $self->{temp_buffer} = ''; - $self->{temp_buffer} .= $_ for (@msgs); - $self->{temp_buffer} .= $tmp; + if( $t and $val ) { + my @msgs = $val =~ /(<$t[^>]*>.*?<\/$t>)/g; + $val = shift(@msgs); + + if (@msgs) { + my $tmp = $self->{temp_buffer}; + + $self->{temp_buffer} = ''; + $self->{temp_buffer} .= $_ for (@msgs); + $self->{temp_buffer} .= $tmp; + } } return $val; - }