From 2157f22669135cece2ddcdc00c8fd4774ba656d8 Mon Sep 17 00:00:00 2001 From: "Jan M. Hochstein" Date: Sat, 18 Jun 2016 15:46:05 +0200 Subject: [PATCH] Set ->message to prevent undef error --- onvif/modules/lib/WSDiscovery/TransportUDP.pm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/onvif/modules/lib/WSDiscovery/TransportUDP.pm b/onvif/modules/lib/WSDiscovery/TransportUDP.pm index edc837da6b..007fcf053f 100644 --- a/onvif/modules/lib/WSDiscovery/TransportUDP.pm +++ b/onvif/modules/lib/WSDiscovery/TransportUDP.pm @@ -145,17 +145,18 @@ sub send_receive { } if($last_response) { - $self->code(); - $self->message(); - $self->is_success(1); - $self->status('OK'); + $self->set_code(); + $self->set_message(""); + $self->set_is_success(1); + $self->set_status('OK'); } else{ - $self->code(); - $self->message(); - $self->is_success(0); - $self->status('TIMEOUT'); + $self->set_code(); + $self->set_message("Timed out waiting for response"); + $self->set_is_success(0); + $self->set_status('TIMEOUT'); } + return $last_response; }