BUGFIX: NaN in the error log

This commit is contained in:
2019-06-13 06:17:48 +10:00
parent 97cd980e2b
commit 68f0018f9d
+1 -1
View File
@@ -112,7 +112,7 @@ const isSpying = (connection, user, cb) => {
const getLadderData = (connection, field, start, length, cb) => { const getLadderData = (connection, field, start, length, cb) => {
//moved here for reusability //moved here for reusability
let query = 'SELECT accounts.id AS id, username, soldiers, recruits, gold FROM accounts JOIN profiles ON accounts.id = profiles.accountId ORDER BY -ladderRank DESC LIMIT ?, ?;'; let query = 'SELECT accounts.id AS id, username, soldiers, recruits, gold FROM accounts JOIN profiles ON accounts.id = profiles.accountId ORDER BY -ladderRank DESC LIMIT ?, ?;';
connection.query(query, [Math.max(0, start), Math.max(0, length)], (err, results) => { connection.query(query, [Math.max(0, start || 0), Math.max(0, length || 0)], (err, results) => {
cb(err, results); cb(err, results);
}); });
}; };