From 9587b6c270d65f010db0656ad322121d39c7d997 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 24 Dec 2015 22:56:35 +0100 Subject: [PATCH] Prevent potential division by zero --- src/main/java/de/todesbaum/jsite/main/CLI.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/de/todesbaum/jsite/main/CLI.java b/src/main/java/de/todesbaum/jsite/main/CLI.java index 3280551..1765074 100644 --- a/src/main/java/de/todesbaum/jsite/main/CLI.java +++ b/src/main/java/de/todesbaum/jsite/main/CLI.java @@ -272,6 +272,9 @@ public class CLI implements InsertListener { */ @Override public void projectInsertProgress(Project project, int succeeded, int failed, int fatal, int total, boolean finalized) { + if (total == 0) { + return; + } outputWriter.println("Progress: " + succeeded + " done, " + failed + " failed, " + fatal + " fatal, " + total + " total" + (finalized ? " (finalized)" : "") + ", " + ((succeeded + failed + fatal) * 100 / total) + "%"); } -- 2.7.4