From a6d5c2b614853779a7f002d00921528e6568b251 Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Fri, 3 Jan 2025 23:08:39 +0100 Subject: [PATCH] Verify if device is nil, if so do not proceed (avoic panic) --- machinery/src/onvif/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/machinery/src/onvif/main.go b/machinery/src/onvif/main.go index c4e1936..efc3abb 100644 --- a/machinery/src/onvif/main.go +++ b/machinery/src/onvif/main.go @@ -986,6 +986,10 @@ func CreatePullPointSubscription(dev *onvif.Device) (string, error) { // For the time being we are just interested in the digital inputs and outputs, therefore // we have set the topic to the followin filter. terminate := xsd.String("PT60S") + if dev == nil { + return pullPointAdress, errors.New("dev is nil, ONVIF was not able to connect to the device") + } + resp, err := dev.CallMethod(event.CreatePullPointSubscription{ InitialTerminationTime: &terminate,