Skip to content

Commit afd49c9

Browse files
authored
Merge pull request #17 from jeankedotcom/summary-error
Check for totalLines to be 0 in CoverageSummary.
2 parents a37aa5a + f484e52 commit afd49c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coverlet.core/CoverageSummary.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public CoverageSummaryResult CalculateSummary()
3232
}
3333
}
3434

35-
result.Add(System.IO.Path.GetFileNameWithoutExtension(mod.Key), (linesCovered * 100) / totalLines);
35+
result.Add(System.IO.Path.GetFileNameWithoutExtension(mod.Key), totalLines == 0 ? totalLines : (linesCovered * 100) / totalLines);
3636
}
3737

3838
return result;

0 commit comments

Comments
 (0)