Commit 3a19f669 authored by michael.simon's avatar michael.simon
Browse files

check assertion for null

parent b04dafd6
...@@ -257,14 +257,16 @@ public class UserUpdater implements Serializable { ...@@ -257,14 +257,16 @@ public class UserUpdater implements Serializable {
public SamlUserEntity updateUser(SamlUserEntity user, Assertion assertion, String executor, ServiceEntity service) public SamlUserEntity updateUser(SamlUserEntity user, Assertion assertion, String executor, ServiceEntity service)
throws UserUpdateException { throws UserUpdateException {
samlAsserionDao.deleteAssertionForUser(user); if (assertion != null) {
samlAsserionDao.deleteAssertionForUser(user);
SamlAssertionEntity samlAssertionEntity = samlAsserionDao.createNew();
samlAssertionEntity.setUser(user); SamlAssertionEntity samlAssertionEntity = samlAsserionDao.createNew();
samlAssertionEntity.setAssertionData(samlHelper.prettyPrint(assertion)); samlAssertionEntity.setUser(user);
samlAssertionEntity.setValidUntil(new Date(System.currentTimeMillis() + (4L * 60L * 60L * 1000L))); samlAssertionEntity.setAssertionData(samlHelper.prettyPrint(assertion));
samlAssertionEntity = samlAsserionDao.persist(samlAssertionEntity); samlAssertionEntity.setValidUntil(new Date(System.currentTimeMillis() + (4L * 60L * 60L * 1000L)));
samlAssertionEntity = samlAsserionDao.persist(samlAssertionEntity);
}
Map<String, List<Object>> attributeMap = saml2AssertionService.extractAttributes(assertion); Map<String, List<Object>> attributeMap = saml2AssertionService.extractAttributes(assertion);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment