diff --git a/server/profiles.js b/server/profiles.js index b4d57b1..325813e 100644 --- a/server/profiles.js +++ b/server/profiles.js @@ -436,6 +436,12 @@ const ladderRequest = (connection) => (req, res) => { getBadgesStatistics((err, { statistics }) => { if (err) throw err; + //BUGFIX + if (results.length === 0) { + res.status(200).json([]); + res.end(); + } + for(let i = 0; i < results.length; i++) { getBadgesOwned(connection, results[i].id, (err, { owned }) => { if (err) throw err; @@ -449,6 +455,7 @@ const ladderRequest = (connection) => (req, res) => { //weird, because of async if (i + 1 === results.length) { res.status(200).json(results); + res.end(); log('Ladder sent', req.body.start, req.body.length, results); } }); diff --git a/src/components/panels/badge_text.jsx b/src/components/panels/badge_text.jsx index cea40eb..199b61d 100644 --- a/src/components/panels/badge_text.jsx +++ b/src/components/panels/badge_text.jsx @@ -5,7 +5,7 @@ class BadgeText extends React.Component { render() { if (!this.props.filename) { return ( -
{this.props.children}
+{this.props.children}
); }