]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - routes/api/pods.js
Return next to send a 500 status code
[github/Chocobozzz/PeerTube.git] / routes / api / pods.js
index 3f9e8505221943cfac322243623d77ade9f507d4..8fa29b4f797a7d643df4806bacb7bca26b297a38 100644 (file)
@@ -8,7 +8,7 @@
 
   function listPods (req, res, next) {
     pods.list(function (err, pods_list) {
-      if (err) next(err)
+      if (err) return next(err)
 
       res.json(pods_list)
     })
@@ -16,7 +16,7 @@
 
   function addPods (req, res, next) {
     pods.add(req.body.data, function (err, json) {
-      if (err) next(err)
+      if (err) return next(err)
 
       res.json(json)
     })
@@ -24,7 +24,7 @@
 
   function makeFriends (req, res, next) {
     pods.makeFriends(function (err) {
-      if (err) next(err)
+      if (err) return next(err)
 
       res.sendStatus(204)
     })