From 72165f52411deaf633a7d6c301f0650c94f79671 Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 7 Apr 2017 20:23:39 +0200 Subject: fix NaN stat --- worker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker.js b/worker.js index 5c1c5bf..84203ec 100644 --- a/worker.js +++ b/worker.js @@ -163,7 +163,8 @@ var RABBITMQ_URI = process.env.RABBITMQ_URI || "amqp://localhost", participant_stats.kills = participant.get("kills"); - participant_stats.kill_participation = participant.get("kills") / participant.roster.get("hero_kills"); + if (participant.roster.get("hero_kills") == 0) participant_stats.kill_participation = 0; + else participant_stats.kill_participation = participant.get("kills") / participant.roster.get("hero_kills"); return participant_stats; } -- cgit v1.3.1