Prevent NPE when URIGenerated message comes too late.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 16 Mar 2012 19:22:20 +0000 (20:22 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Fri, 16 Mar 2012 19:22:20 +0000 (20:22 +0100)
This fixes #259.

src/de/todesbaum/jsite/application/ProjectInserter.java

index b14dadb..1859393 100644 (file)
@@ -567,8 +567,8 @@ public class ProjectInserter implements FileScannerListener, Runnable {
                                        boolean finalized = Boolean.parseBoolean(message.get("FinalizedTotal"));
                                        fireProjectInsertProgress(succeeded, failed, fatal, total, finalized);
                                }
-                               success = "PutSuccessful".equals(messageName);
-                               finished = success || "PutFailed".equals(messageName) || messageName.endsWith("Error");
+                               success |= "PutSuccessful".equals(messageName);
+                               finished = (success && (finalURI != null)) || "PutFailed".equals(messageName) || messageName.endsWith("Error");
                        }
                }