diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index d093da4e09a50a40bcdc6ce374b36320d85a569b..94613b5f9be1f2e7d689775e2d840331f36f19dd 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.');
 		}
 	}