Fix: divide by zero

This commit is contained in:
Laurent Clouet
2024-06-04 18:17:57 +02:00
parent 3131a0c6c2
commit 702c004355

View File

@@ -43,6 +43,8 @@ public class DownloadProgress {
public synchronized void addProgress(long progress) { public synchronized void addProgress(long progress) {
this.partial += progress; this.partial += progress;
if (this.total != 0) {
gui.status(String.format(this.guiPattern + " %.0f %%", 100.0f * this.partial / this.total)); gui.status(String.format(this.guiPattern + " %.0f %%", 100.0f * this.partial / this.total));
} }
} }
}