From 698a7bbdc0c5c1e58f43513eef2a8e9e90c3db56 Mon Sep 17 00:00:00 2001
From: Alexander Benjamin <alx_benjamin@yahoo.com>
Date: Mon, 10 Aug 2015 17:50:19 +0200
Subject: [PATCH] Issue #2548787: Fixed debug() message display

---
 core/includes/errors.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/includes/errors.inc b/core/includes/errors.inc
index 99cab85..31c1ae7 100644
--- a/core/includes/errors.inc
+++ b/core/includes/errors.inc
@@ -249,7 +249,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
       exit;
     }
     else {
-      if (\Drupal::hasService('session')) {
+      if (\Drupal::hasService('session') && isset($class)) {
         // Message display is dependent on sessions being available.
         drupal_set_message(SafeMarkup::set($message), $class, TRUE);
       }
-- 
1.9.1

