Prevent potential division by zero
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Thu, 24 Dec 2015 21:56:35 +0000 (22:56 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Thu, 24 Dec 2015 21:56:35 +0000 (22:56 +0100)
src/main/java/de/todesbaum/jsite/main/CLI.java

index 3280551..1765074 100644 (file)
@@ -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) + "%");
        }