Sfoglia il codice sorgente

Add edge case if no parameter is provided

sbkwgh 8 anni fa
parent
commit
ef0e5bb464
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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) {