Skip to content
Browse files

fixing bug on updating stats

  • Loading branch information...
1 parent 89e6748 commit 5a4ab56423f9f94cf0a3044fc1b256788e2170ae @masylum committed Dec 16, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/gamesManager.js
View
4 lib/gamesManager.js
@@ -54,7 +54,9 @@ module.exports = function (options, STATE) {
, finished_games = (finished) ? stat.finished_games + 1 : stat.finished_games
, _score = (puntuation > stat.max_puntuation) ? _.extend(score, new_score) : stat.score;
- delete _score.user;
+ if (_score && _score.user) {
+ delete _score.user;
+ }
db.statistics.update(
{_id: stat._id}

0 comments on commit 5a4ab56

Please sign in to comment.
Something went wrong with that request. Please try again.