From f484e524c400e1f2845a9eb6c8fe102d32f720c9 Mon Sep 17 00:00:00 2001 From: jeankedotcom Date: Mon, 26 Mar 2018 15:01:44 +0200 Subject: [PATCH] Check for totalLines to be 0 in CoverageSummary. --- src/coverlet.core/CoverageSummary.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coverlet.core/CoverageSummary.cs b/src/coverlet.core/CoverageSummary.cs index 1f56e6405..61414b3db 100644 --- a/src/coverlet.core/CoverageSummary.cs +++ b/src/coverlet.core/CoverageSummary.cs @@ -32,7 +32,7 @@ public CoverageSummaryResult CalculateSummary() } } - result.Add(System.IO.Path.GetFileNameWithoutExtension(mod.Key), (linesCovered * 100) / totalLines); + result.Add(System.IO.Path.GetFileNameWithoutExtension(mod.Key), totalLines == 0 ? totalLines : (linesCovered * 100) / totalLines); } return result;