diff options
author | Panagiotis PJ Papadomitsos <ppapadomitsos@splunk.com> | 2015-12-16 15:07:37 -0800 |
---|---|---|
committer | Panagiotis PJ Papadomitsos <ppapadomitsos@splunk.com> | 2015-12-16 15:07:37 -0800 |
commit | ae9c1fa0f8c3243ce6cee267e222625a54e85c7d (patch) | |
tree | 08710fc3c555da9c2f31228527c411db32d1fb44 | |
parent | 8c055a7d96c40d278f0148b91f996edf1873cf5d (diff) |
Account for division by zero
-rw-r--r-- | src/rebar_prv_cover.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rebar_prv_cover.erl b/src/rebar_prv_cover.erl index f814e2a..c915141 100644 --- a/src/rebar_prv_cover.erl +++ b/src/rebar_prv_cover.erl @@ -238,6 +238,8 @@ seperator(Width) -> format(String, Width) -> io_lib:format("~*.ts", [Width, String]). +calculate_total(Stats) when length(Stats) =:= 0 -> + "0%"; calculate_total(Stats) -> TotalStats = length(Stats), TotalCovInt = round(lists:foldl( |