Author: matthew.hayes
Date: 2011-10-11 15:23:37 -0400 (Tue, 11 Oct 2011)
New Revision: 1300
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/writers/BaseWriter.java
Log:
Updated Basewriter to prevent NPE on null attribute value
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/writers/BaseWriter.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/writers/BaseWriter.java 2011-10-10
15:45:55 UTC (rev 1299)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/writers/BaseWriter.java 2011-10-11
19:23:37 UTC (rev 1300)
@@ -189,13 +189,15 @@
{
for (Object attributeValue : attributeValues)
{
- if (attributeValue instanceof String)
- {
- writeStringAttributeValue((String) attributeValue);
- }
- else
- throw new RuntimeException(ErrorCodes.WRITER_UNSUPPORTED_ATTRIB_VALUE
- + attributeValue.getClass().getName());
+ if (attributeValue != null) {
+ if (attributeValue instanceof String)
+ {
+ writeStringAttributeValue((String) attributeValue);
+ }
+ else
+ throw new RuntimeException(ErrorCodes.WRITER_UNSUPPORTED_ATTRIB_VALUE
+ + attributeValue.getClass().getName());
+ }
}
}
}
Show replies by date