diff --git a/index.js b/index.js index 92148ca..695a3d1 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ app.put('/api/connect/:jobid', (req, res) => { ws_[id].message = data; }) ws_[id].connection.on('close', function() { - if (ws_[id].connection) { + if (ws_[id]) { ws_[id].connection.terminate(); } })