diff --git a/CodenameOne/src/com/codename1/properties/SQLMap.java b/CodenameOne/src/com/codename1/properties/SQLMap.java index 786b6b838d..ed7ee5ce56 100644 --- a/CodenameOne/src/com/codename1/properties/SQLMap.java +++ b/CodenameOne/src/com/codename1/properties/SQLMap.java @@ -726,7 +726,9 @@ private SelectBuilder(PropertyBase property, String operator, String prefix, Str this.prefix = prefix; this.suffix = suffix; this.parent = parent; - parent.child = this; + if (parent != null) { + parent.child = this; + } } /** diff --git a/CodenameOne/src/com/codename1/ui/SideMenuBar.java b/CodenameOne/src/com/codename1/ui/SideMenuBar.java index 12f9fe1813..7f7daa00a1 100644 --- a/CodenameOne/src/com/codename1/ui/SideMenuBar.java +++ b/CodenameOne/src/com/codename1/ui/SideMenuBar.java @@ -243,6 +243,9 @@ protected Button createOpenButton() { * {@inheritDoc} */ protected void installMenuBar() { + if (parent == null) { + return; + } if (parent.getClientProperty("Menu") != null) { return; } diff --git a/maven/core-unittests/src/test/java/com/codename1/properties/SQLMapTest.java b/maven/core-unittests/src/test/java/com/codename1/properties/SQLMapTest.java index 66a93922e5..9635d6372a 100644 --- a/maven/core-unittests/src/test/java/com/codename1/properties/SQLMapTest.java +++ b/maven/core-unittests/src/test/java/com/codename1/properties/SQLMapTest.java @@ -131,12 +131,9 @@ public void testSelectBuild() throws Exception { Database db = com.codename1.ui.Display.getInstance().openOrCreate("test.db"); SQLMap sqlMap = SQLMap.create(db); - // This is expected to throw NPE because of broken constructor logic in SelectBuilder - try { - sqlMap.selectBuild(); - Assertions.fail("Expected NullPointerException from selectBuild()"); - } catch (NullPointerException e) { - // Expected - } + // This was expected to throw NPE because of broken constructor logic in SelectBuilder + // But we fixed it, so now it should work. + SQLMap.SelectBuilder builder = sqlMap.selectBuild(); + Assertions.assertNotNull(builder); } } diff --git a/maven/core-unittests/src/test/java/com/codename1/social/Login1Test.java b/maven/core-unittests/src/test/java/com/codename1/social/Login1Test.java index c31476ae97..46bdc9044c 100644 --- a/maven/core-unittests/src/test/java/com/codename1/social/Login1Test.java +++ b/maven/core-unittests/src/test/java/com/codename1/social/Login1Test.java @@ -46,6 +46,11 @@ public void showAuthentication(ActionListener al) { login.setOauth2URL("url"); login.setRedirectURI("uri"); - login.doLogin(); + com.codename1.junit.TestLogger.install(); + try { + login.doLogin(); + } finally { + com.codename1.junit.TestLogger.remove(); + } } }