From e21f6944e484dd24f5f7f2aca7a39b6a25b32539 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 14 Oct 2013 13:55:04 +0200 Subject: Bugfix: NullPointer if SAML1 is deactivated and no DB entry exists --- id/ConfigWebTool/.classpath | 1 + id/ConfigWebTool/pom.xml | 1 + .../egovernment/moa/id/configuration/data/oa/OASAML1Config.java | 9 +++++++-- .../moa/id/configuration/struts/action/EditOAAction.java | 6 ++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/id/ConfigWebTool/.classpath b/id/ConfigWebTool/.classpath index 5bde2110d..0e6d0b69f 100644 --- a/id/ConfigWebTool/.classpath +++ b/id/ConfigWebTool/.classpath @@ -26,6 +26,7 @@ + diff --git a/id/ConfigWebTool/pom.xml b/id/ConfigWebTool/pom.xml index 37ba92d7c..19fcc269c 100644 --- a/id/ConfigWebTool/pom.xml +++ b/id/ConfigWebTool/pom.xml @@ -39,6 +39,7 @@ MOA.id.server moa-id-lib + 1.9.96-SNAPSHOT diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java index 951052877..c4c945bec 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java @@ -29,8 +29,13 @@ public class OASAML1Config { provideFullMandateData = saml1.isProvideFullMandatorData(); provideIdentityLink = saml1.isProvideIdentityLink(); provideStammZahl = saml1.isProvideStammzahl(); - useCondition = saml1.isUseCondition(); - conditionLength = saml1.getConditionLength().intValue(); + + if (saml1.isUseCondition() != null) + useCondition = saml1.isUseCondition(); + + if (saml1.getConditionLength() != null) + conditionLength = saml1.getConditionLength().intValue(); + if (saml1.isIsActive() != null) isActive = saml1.isIsActive(); } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java index 3ee870d11..ca547204f 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java @@ -528,7 +528,8 @@ ServletResponseAware { } UserDatabase userdb = ConfigurationDBRead.getUserWithID(authUser.getUserID()); - if (!authUser.isAdmin() && !userdb.isIsMailAddressVerified()) { + if (!authUser.isAdmin() && userdb.isIsMailAddressVerified() != null && + !userdb.isIsMailAddressVerified()) { log.info("Online-Applikation managemant disabled. Mail address is not verified."); addActionError(LanguageHelper.getErrorString("error.editoa.mailverification")); return Constants.STRUTS_SUCCESS; @@ -816,13 +817,14 @@ ServletResponseAware { if (saml1 == null) { saml1 = new OASAML1(); authoa.setOASAML1(saml1); + saml1.setIsActive(false); } if (authUser.isAdmin()) { saml1.setIsActive(saml1OA.isActive()); } - if (saml1.isIsActive()) { + if (saml1.isIsActive() != null && saml1.isIsActive()) { saml1.setProvideAUTHBlock(saml1OA.isProvideAuthBlock()); saml1.setProvideCertificate(saml1OA.isProvideCertificate()); saml1.setProvideFullMandatorData(saml1OA.isProvideFullMandateData()); -- cgit v1.2.3