Patching bug if newScoreObject is incomplete

This commit is contained in:
Michael Schmatz 2014-05-17 12:02:34 -07:00
parent 3c9428ffd3
commit a46714b1b6

View file

@ -449,7 +449,7 @@ addMatchToSessions = (newScoreObject, callback) ->
matchObject.opponents[sessionID].name = session.name
matchObject.opponents[sessionID].totalScore = session.totalScore
matchObject.opponents[sessionID].metrics = {}
matchObject.opponents[sessionID].metrics.rank = Number(newScoreObject[sessionID].gameRanking)
matchObject.opponents[sessionID].metrics.rank = Number(newScoreObject[sessionID]?.gameRanking ? 0)
#log.info "Match object computed, result: #{matchObject}"
#log.info "Writing match object to database..."