]> WPIA git - gigi.git/blobdiff - util-testing/org/cacert/gigi/DevelLauncher.java
fix: Possible NPE when no menu previously existed
[gigi.git] / util-testing / org / cacert / gigi / DevelLauncher.java
index 6639635b0cbb551bef7ba9caf1e1cc06262956b0..736947d55ac566675d62c25b93d06fa2120058ff 100644 (file)
@@ -122,8 +122,12 @@ public class DevelLauncher {
 
             // Check if we got a proper map (as much as we can tell)
             Object pagesObj = pageF.get(gigi);
+            if ( !(pagesObj instanceof Map)) {
+                throw new Error("Invalid state when initializing page structure");
+            }
+
             @SuppressWarnings("unchecked")
-            HashMap<String, Page> pages = pagesObj instanceof Map ? new HashMap<>((Map<String, Page>) pagesObj) : null;
+            HashMap<String, Page> pages = new HashMap<>((Map<String, Page>) pagesObj);
 
             pages.put("/manage", new Page("Page-manager") {