senecajs / seneca-transport

Seneca micro-services message transport over TCP and HTTP.
MIT License
63 stars 45 forks source link

tcp transport crash on disconnect #149

Closed calibermind closed 5 years ago

calibermind commented 7 years ago

When the connection is empty, the .find will return undefined therefore the following will cause a crash: .find(connections, { clientOptions: clientOptions }).setup = false

this is line 161 seneca-transport/lib/tcp.js.

one solution is -

if (connections.length !== 0 ){ _.find(connections, { clientOptions: clientOptions }).setup = false }

friedemannsommer commented 7 years ago

This issue refers to #144