From 47b0b4f1439fe56f192a93cfa980d6634749ddef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 7 Jun 2015 13:38:04 +0200 Subject: [PATCH] fix a division through zero --- OpenRA.Game/Support/PerfItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Support/PerfItem.cs b/OpenRA.Game/Support/PerfItem.cs index 76f3ab50dc..bd314cd4e1 100644 --- a/OpenRA.Game/Support/PerfItem.cs +++ b/OpenRA.Game/Support/PerfItem.cs @@ -62,7 +62,7 @@ namespace OpenRA.Support i++; } - return sum / i; + return i == 0 ? sum : sum / i; } public double LastValue