diff --git a/www/auth/login-feide.php b/www/auth/login-feide.php
index 52a99407e8c4844f62fff5e20db4b30409d250af..b5bf2c304de9167422c0a6c03211c8348f5b82a9 100644
--- a/www/auth/login-feide.php
+++ b/www/auth/login-feide.php
@@ -51,10 +51,14 @@ if (!array_key_exists('protocol', $_REQUEST)) {
 if ($_REQUEST['protocol'] != 'saml2') {
         SimpleSAML_Utilities::fatalError($session->getTrackID(), null, new Exception('This login module only works with SAML 2.0'));
 }
- 
-$protocol = $_REQUEST['protocol'];
-$authid = $_REQUEST['AuthId'];
-$authrequestcache = $session->getAuthnRequest($protocol, $authid);
+
+try {
+        $protocol = $_REQUEST['protocol'];
+        $authid = $_REQUEST['AuthId'];
+        $authrequestcache = $session->getAuthnRequest($protocol, $authid);
+} catch (Exception $e) {
+        SimpleSAML_Utilities::fatalError($session->getTrackID(), 'NOSESSION', $e);
+}
  
 $spentityid = $authrequestcache['Issuer'];
 $spmetadata = $metadata->getMetadata($spentityid, 'saml20-sp-remote');