[java-shib-attribute] branch main updated: Handle nulls properly.

Scott Cantor cantor.2 at osu.edu
Tue Aug 9 13:01:27 UTC 2022


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

scantor pushed a commit to branch main
in repository java-shib-attribute.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=8b2ec218a4f02899811cbea83a122f5cf64572df

The following commit(s) were added to refs/heads/main by this push:
     new 8b2ec218a Handle nulls properly.
8b2ec218a is described below

commit 8b2ec218a4f02899811cbea83a122f5cf64572df
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Aug 9 09:01:22 2022 -0400

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

diff --git a/shib-saml-attribute-impl/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2DateTimeAttributeTranscoder.java b/shib-saml-attribute-impl/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2DateTimeAttributeTranscoder.java
index e85cbf2b1..e645f6c53 100644
--- a/shib-saml-attribute-impl/src/main/java/net/shibboleth/idp/saml/attribute/transcoding/impl/SAML2DateTimeAttributeTranscoder.java
+++ b/shib-saml-attribute-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;
     }
     
     /**
@@ -162,4 +169,4 @@ public class SAML2DateTimeAttributeTranscoder extends AbstractSAML2AttributeTran
         return null;
     }
 
-}
\ No newline at end of file
+}

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


More information about the commits mailing list