From c6b63d7af5214e6a2b480a4eed840be92cebab01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no>
Date: Mon, 16 Oct 2017 12:32:48 +0200
Subject: [PATCH] bugfix: Allow the "application" conf option to be missing.

---
 lib/SimpleSAML/Utils/HTTP.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php
index 624e8b505..834901cb3 100644
--- a/lib/SimpleSAML/Utils/HTTP.php
+++ b/lib/SimpleSAML/Utils/HTTP.php
@@ -783,8 +783,8 @@ class HTTP
              */
 
             /** @var \SimpleSAML_Configuration $appcfg */
-            $appcfg = $cfg->getConfigItem('application', array());
-            $appurl = $appcfg->getString('baseURL', '');
+            $appcfg = $cfg->getConfigItem('application', null);
+            $appurl = ($appcfg instanceof \SimpleSAML_Configuration) ? $appcfg->getString('baseURL', '') : '';
             if (!empty($appurl)) {
                 $protocol = parse_url($appurl, PHP_URL_SCHEME);
                 $hostname = parse_url($appurl, PHP_URL_HOST);
-- 
GitLab