From 34fafeef7b3760c3383e143f8dc43985a035630a Mon Sep 17 00:00:00 2001
From: Andjelko Horvat <comel@vingd.com>
Date: Mon, 5 Mar 2012 10:35:09 +0000
Subject: [PATCH] SAML2_HTTPArtifact: $idpmetadata check (issue #481).

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3035 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SAML2/HTTPArtifact.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/SAML2/HTTPArtifact.php b/lib/SAML2/HTTPArtifact.php
index f049272cc..d57274212 100644
--- a/lib/SAML2/HTTPArtifact.php
+++ b/lib/SAML2/HTTPArtifact.php
@@ -80,6 +80,9 @@ class SAML2_HTTPArtifact extends SAML2_Binding {
 
 		$idpmetadata = $metadataHandler->getMetaDataConfigForSha1($sourceId, 'saml20-idp-remote');
 
+		if ($idpmetadata === NULL) {
+			throw new Exception('No metadata found for remote provider with SHA1 ID: ' . var_export($sourceId, TRUE));
+		}
 
 		$endpoint = NULL;
 		foreach ($idpmetadata->getEndpoints('ArtifactResolutionService') as $ep) {
-- 
GitLab