agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
679 stars 230 forks source link

Add callback call check #305

Closed TA2k closed 8 months ago

TA2k commented 8 months ago

I see a crash when called unsubscribed without callback to prevent a crash I added a check

2023-10-20 11:04:50.893 - error: tapo.0 (681712) uncaught exception: callback.call is not a function
2023-10-20 11:04:50.894 - error: tapo.0 (681712) TypeError: callback.call is not a function
at Cam. (/opt/iobroker/node_modules/onvif/lib/events.js:309:14)
at parseSOAPString (/opt/iobroker/node_modules/onvif/lib/utils.js:108:3)
at IncomingMessage. (/opt/iobroker/node_modules/onvif/lib/cam.js:297:4)
at IncomingMessage.emit (node:events:526:35)
at IncomingMessage.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1359:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)