diff --git a/core/includes/errors.inc b/core/includes/errors.inc index caa2f553e2..1a40a5358e 100644 --- a/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -331,7 +331,12 @@ function _drupal_get_error_level() { $error_level = \Drupal::config('system.logging')->get('error_level'); } catch (\Exception $e) { - $error_level = $GLOBALS['config']['system.logging']['error_level'] ?? ERROR_REPORTING_HIDE; + if (!is_object($GLOBALS['config']) || get_class($GLOBALS['config']) != 'SimpleSAML\Configuration') { + $error_level = $GLOBALS['config']['system.logging']['error_level'] ?? ERROR_REPORTING_HIDE; + } + else { + $error_level = ERROR_REPORTING_HIDE; + } } // If there is no container or if it has no config.factory service, we are