From ae9c1fa0f8c3243ce6cee267e222625a54e85c7d Mon Sep 17 00:00:00 2001 From: Panagiotis PJ Papadomitsos Date: Wed, 16 Dec 2015 15:07:37 -0800 Subject: Account for division by zero --- src/rebar_prv_cover.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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( -- cgit v1.1