]> WPIA git - gigi.git/commitdiff
fix: Possible NPE when no menu previously existed
authorBenny Baumann <BenBE1987@gmx.net>
Sun, 31 Jul 2016 12:16:37 +0000 (14:16 +0200)
committerBenny Baumann <BenBE1987@gmx.net>
Sun, 31 Jul 2016 15:03:14 +0000 (17:03 +0200)
Change-Id: I2cc63e42b339a6ab3a5e482b22ef6010f42388ac

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") {