From b36fbaf5c2aa7cbdf0a6f8b0d5ca37b7ef2ea221 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 3 Dec 2012 12:27:34 +0000
Subject: [PATCH] saml: Fix NULL return from
 saml_IdP_SAML2::getAssociationConfig().

This function should not return NULL, but did so due to a missing
return statement. This patch adds that return statement, and fixes
the documentation for the function.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3206 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/saml/lib/IdP/SAML2.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index d093da4e0..94613b5f9 100644
--- a/modules/saml/lib/IdP/SAML2.php
+++ b/modules/saml/lib/IdP/SAML2.php
@@ -551,14 +551,14 @@ class sspmod_saml_IdP_SAML2 {
 	 *
 	 * @param SimpleSAML_IdP $idp  The IdP the association belongs to.
 	 * @param array $association  The SP association.
-	 * @return SimpleSAML_Configuration|NULL  Configuration object for the SP metadata.
+	 * @return SimpleSAML_Configuration  Configuration object for the SP metadata.
 	 */
 	public static function getAssociationConfig(SimpleSAML_IdP $idp, array $association) {
 		$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 		try {
 			return $metadata->getMetaDataConfig($association['saml:entityID'], 'saml20-sp-remote');
 		} catch (Exception $e) {
-			SimpleSAML_Configuration::loadFromArray(array(), 'Unknown SAML 2 entity.');
+			return SimpleSAML_Configuration::loadFromArray(array(), 'Unknown SAML 2 entity.');
 		}
 	}
 
-- 
GitLab