Author: anil.saldhana(a)jboss.com
Date: 2011-06-28 11:59:54 -0400 (Tue, 28 Jun 2011)
New Revision: 1040
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java
Log:
avoid NPE
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java 2011-06-27
17:31:32 UTC (rev 1039)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java 2011-06-28
15:59:54 UTC (rev 1040)
@@ -181,14 +181,17 @@
private Node getBinaryToken(SOAPHeader soapHeader)
{
- NodeList children = soapHeader.getChildNodes();
- int length = children != null ? children.getLength() : 0;
- for (int i = 0; i < length; i++)
+ if (soapHeader != null)
{
- Node child = children.item(i);
- if (child.getNodeName().contains(WSSE.BINARY_SECURITY_TOKEN))
+ NodeList children = soapHeader.getChildNodes();
+ int length = children != null ? children.getLength() : 0;
+ for (int i = 0; i < length; i++)
{
- return child;
+ Node child = children.item(i);
+ if (child.getNodeName().contains(WSSE.BINARY_SECURITY_TOKEN))
+ {
+ return child;
+ }
}
}
return null;
Show replies by date