From c90db21929d963f51e791d4984c57176a4508ec0 Mon Sep 17 00:00:00 2001 From: Olle Haerstedt Date: Tue, 9 Oct 2018 17:14:22 +0200 Subject: [PATCH] Dev: Check if status code is set before use --- application/core/LSYii_Application.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/core/LSYii_Application.php b/application/core/LSYii_Application.php index 12b4bea8aed..c6929af95b7 100644 --- a/application/core/LSYii_Application.php +++ b/application/core/LSYii_Application.php @@ -346,7 +346,8 @@ public function onException($event) } else { /* Here we have different possibility : maybe 400/401/403/404 with debug < 2 except for forced superadmin (currently : the 4 part don't show intersting information with debug*/ /* 500 always if debug and for (forced) superadmin even if no debug is set (and try to show complete error in this case (see issue by olle about white page and log */ - if ((Yii::app()->getConfig('debug')<1 /* || Permission::hasGlobalPermission('superadmin') */) || $event->exception->statusCode=='404') { + if ((Yii::app()->getConfig('debug')<1 /* || Permission::hasGlobalPermission('superadmin') */) + || (isset($event->exception->statusCode) && $event->exception->statusCode=='404')) { Yii::app()->setComponent('errorHandler', array( 'errorAction'=>'surveys/error', ));