Skip to content

Commit

Permalink
hotfix: position or zoom can be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Jan 3, 2024
1 parent 95ed1f0 commit deb0a3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion machinery/src/onvif/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit deb0a3f

Please sign in to comment.