Skip to content

Commit f484e52

Browse files
committed
Check for totalLines to be 0 in CoverageSummary.
1 parent a37aa5a commit f484e52

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)