mmaelzer / mjpeg-camera

A node.js library and/or server for connecting to, recording from, and streaming mjpeg cameras.
70 stars 23 forks source link

keepalive called after connection.abort() resulting in error. #15

Closed vill3m647 closed 2 years ago

vill3m647 commented 2 years ago

When camera.stop() is called and the connection is aborted then keepalive is called by this line: this.connection.on('error', this.keepalive.bind(this)); and so when stop() is called again in keepalive() it tries to abort the connection that has already been aborted and set to null resulting in error: TypeError: Cannot read properties of null (reading 'abort')

Using Node v16.14.2

mmaelzer commented 2 years ago

Thanks for filing this issue. It should be fixed now.