diff --git a/api/players/players.js b/api/players/players.js index 0282867..c490f14 100644 --- a/api/players/players.js +++ b/api/players/players.js @@ -54,7 +54,7 @@ playerApi.get('/search', async (req, res) => { const players = await Player.find({ name: { $regex: name, $options: 'i' }}).sort([[sort, order]]).limit(20).skip((page - 1) * 20) - if (!players) + if (!players[0]) return res.json({ success: false, response: "No players found!"