From 15d63ac82aa4efcf0034b3807594f902a2eb5f1d Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 31 Mar 2009 07:14:44 +0000
Subject: [PATCH] MetaDataStorageSource::getEntityIdFromHostPath: Handle
 missing metadata set.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1454 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Metadata/MetaDataStorageSource.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageSource.php b/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
index 0c650d5ab..443643db3 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
@@ -107,6 +107,10 @@ abstract class SimpleSAML_Metadata_MetaDataStorageSource {
 	public function getEntityIdFromHostPath($hostPath, $set, $type = 'entityid') {
 
 		$metadataSet = $this->getMetadataSet($set);
+		if ($metadataSet === NULL) {
+			/* This metadata source does not have this metadata set. */
+			return NULL;
+		}
 
 		foreach($metadataSet AS $index => $entry) {
 
-- 
GitLab