Fixed NullPointer on requests for which no metadata exists.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 17 May 2005 20:57:03 +0000 (20:57 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 17 May 2005 20:57:03 +0000 (20:57 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1499 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/provider/SSOHandler.java

index 909fd93..a22db3f 100644 (file)
@@ -107,11 +107,11 @@ public abstract class SSOHandler extends BaseHandler implements IdPProtocolHandl
 
                String[] availableMappings = relyingParty.getNameMapperIds();
 
-               SPSSODescriptor role = descriptor.getSPSSODescriptor("urn:oasis:names:tc:SAML:1.1:protocol");
-
                // If we have preferred Name Identifier formats from the metadata, see if the we can find one that is configured
                // for this relying party
-               if (role != null) {
+               SPSSODescriptor role;
+               if (descriptor != null
+                               && (role = descriptor.getSPSSODescriptor("urn:oasis:names:tc:SAML:1.1:protocol")) != null) {
                        Iterator spPreferredFormats = role.getNameIDFormats();
                        while (spPreferredFormats.hasNext()) {