Fix divided by zero when the sync folder is empty (tot = 0)

This commit is contained in:
filoozom 2014-03-03 08:47:52 +01:00
parent 8f41d90ab1
commit b4a1aadd1b

View File

@ -191,7 +191,10 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo {
} }
} }
ci.Completion = 100
if tot != 0 {
ci.Completion = int(100 * have / tot) ci.Completion = int(100 * have / tot)
}
res[node] = ci res[node] = ci
} }