[java-identity-provider] branch maint-4 updated: Handle nulls properly.

Scott Cantor cantor.2 at osu.edu
Tue Aug 9 13:00:09 UTC 2022


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch maint-4
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=a691d091e5f6f6beb106e880a5f1deab353b07ce

The following commit(s) were added to refs/heads/maint-4 by this push:
     new a691d091e Handle nulls properly.
a691d091e is described below

commit a691d091e5f6f6beb106e880a5f1deab353b07ce
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Aug 9 09:00:06 2022 -0400

    Handle nulls properly.
---
 .../transcoding/impl/SAML2DateTimeAttributeTranscoder.java       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2DateTimeAttributeTranscoder.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2DateTimeAttributeTranscoder.java
index e85cbf2b1..dc992f261 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2DateTimeAttributeTranscoder.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2DateTimeAttributeTranscoder.java
@@ -80,7 +80,14 @@ public class SAML2DateTimeAttributeTranscoder extends AbstractSAML2AttributeTran
             @Nullable final ProfileRequestContext profileRequestContext, @Nonnull final Attribute attribute,
             @Nonnull final TranscodingRule rule, @Nullable final XMLObject value) {
         
-        return value != null ? new DateTimeAttributeValue(getDateTimeValue(rule, value)) : null;
+        if (value != null) {
+            final Instant retVal = getDateTimeValue(rule, value);
+            if (retVal != null) {
+                return new DateTimeAttributeValue(retVal);
+            }
+        }
+        
+        return null;
     }
     
     /**

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list