Bläddra i källkod

Add edge case if no parameter is provided

sbkwgh 8 år sedan
förälder
incheckning
ef0e5bb464
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2 0
      routes/user.js

+ 2 - 0
routes/user.js

@@ -334,6 +334,8 @@ router.put('/:username', async (req, res) => {
 				validationErrors.push(Errors.invalidLoginCredentials)
 				throw validationErrors
 			}
+		} else {
+			res.json({})
 		}
 	} catch (e) {
 		if(validationErrors.length) {