From deb0a3ff1ffd1c766265c94e486acdebb2282ab8 Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Wed, 3 Jan 2024 13:37:38 +0100 Subject: [PATCH] hotfix: position or zoom can be nil --- machinery/src/onvif/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machinery/src/onvif/main.go b/machinery/src/onvif/main.go index ac7c945..367197a 100644 --- a/machinery/src/onvif/main.go +++ b/machinery/src/onvif/main.go @@ -311,7 +311,7 @@ func GetPositionFromDevice(configuration models.Configuration) (xsdonvif.PTZVect if err == nil { // Get the PTZ configurations from the device position, err := GetPosition(device, token) - if err == nil { + if err == nil && position.PanTilt != nil && position.Zoom != nil { // float to string x := strconv.FormatFloat(position.PanTilt.X, 'f', 6, 64) y := strconv.FormatFloat(position.PanTilt.Y, 'f', 6, 64)