From b4a1aadd1b5509f292982446617d6d6709ddfd9f Mon Sep 17 00:00:00 2001 From: filoozom Date: Mon, 3 Mar 2014 08:47:52 +0100 Subject: [PATCH] Fix divided by zero when the sync folder is empty (tot = 0) --- model.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/model.go b/model.go index 2617fb42..75fd8c78 100644 --- a/model.go +++ b/model.go @@ -191,7 +191,10 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo { } } - ci.Completion = int(100 * have / tot) + ci.Completion = 100 + if tot != 0 { + ci.Completion = int(100 * have / tot) + } res[node] = ci }