Commit ed598c0b authored by Iuri Matias's avatar Iuri Matias

add missing return

parent 7a53dffe
...@@ -19,7 +19,7 @@ app.get('/', (req, res) => { ...@@ -19,7 +19,7 @@ app.get('/', (req, res) => {
app.use((req, res) => { app.use((req, res) => {
provider.sendAsync(req.body, (err, jsonResponse) => { provider.sendAsync(req.body, (err, jsonResponse) => {
if (err) { if (err) {
res.send({error: err}) return res.send({error: err})
} }
res.send(jsonResponse) res.send(jsonResponse)
}) })
...@@ -29,7 +29,7 @@ app.ws('/', (ws, req) => { ...@@ -29,7 +29,7 @@ app.ws('/', (ws, req) => {
ws.on('message', function (msg) { ws.on('message', function (msg) {
provider.sendAsync(JSON.parse(msg), (err, jsonResponse) => { provider.sendAsync(JSON.parse(msg), (err, jsonResponse) => {
if (err) { if (err) {
ws.send({error: err}) return ws.send({error: err})
} }
ws.send(JSON.stringify(jsonResponse)) ws.send(JSON.stringify(jsonResponse))
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment