Skip to content

Commit

Permalink
Merge pull request #151 from kerberos-io/fix/pullpoint-crash
Browse files Browse the repository at this point in the history
Verify if device is nil, if so do not proceed (avoic panic)
cedricve authored Jan 6, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 78cad6c + a6d5c2b commit 4fde419
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions machinery/src/onvif/main.go
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 4fde419

Please sign in to comment.