diff --git a/models/repos.js b/models/repos.js index be7381ed..067654df 100644 --- a/models/repos.js +++ b/models/repos.js @@ -292,9 +292,11 @@ function createModel () { var incomplete = dats.filter(function (dat) { return dat.network && dat.progress < 1 }) - var progress = incomplete.reduce(function (acc, dat) { - return acc + dat.progress - }, 0) / incomplete.length + var progress = incomplete.length + ? incomplete.reduce(function (acc, dat) { + return acc + dat.progress + }, 0) / incomplete.length + : 1 if (progress === 1) progress = -1 // deactivate ipc.send('progress', progress)