Fixed error catching...

This commit is contained in:
BurnyLlama 2021-10-03 19:29:10 +02:00
parent 30ea4d671e
commit ac7b31e5a6

View File

@ -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!"