Remove division by zero If there are no remote devices, the completion is assumed to be 100.
1 files changed, 6 insertions(+), 1 deletions(-) M status.go
M status.go => status.go +6 -1
@@ 70,7 70,12 @@ func (client *Client) remoteStatus() *RemoteStatus { sum += status.Completion } totalStatus.Completion = sum / float64(len(connectedDevices)) // Don't divide by zero if len(connectedDevices) == 0 { totalStatus.Completion = 100 } else { totalStatus.Completion = sum / float64(len(connectedDevices)) } return &totalStatus }