From 5cbdbfa6552fe978fc25367f5d909df9b8ec5149 Mon Sep 17 00:00:00 2001 From: wfoojjaec Date: Fri, 30 Apr 2021 20:31:55 +0000 Subject: [PATCH] PHP 8 compatibility PHP warning: Attempt to read property "blocked" on null --- .../admintools/elements/plugins/plugin.admintools.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/components/admintools/elements/plugins/plugin.admintools.php b/core/components/admintools/elements/plugins/plugin.admintools.php index 3423ee1..09ead2d 100644 --- a/core/components/admintools/elements/plugins/plugin.admintools.php +++ b/core/components/admintools/elements/plugins/plugin.admintools.php @@ -52,7 +52,7 @@ } break; case 'OnLoadWebDocument': - if ((!$modx->user->active || $modx->user->Profile->blocked) && $modx->user->isAuthenticated($modx->context->get('key'))) { + if ((!$modx->user->active || (!empty($modx->user->Profile) && $modx->user->Profile->blocked)) && $modx->user->isAuthenticated($modx->context->get('key'))) { $modx->runProcessor('security/logout'); } if ($modx->getOption('admintools_alternative_permissions', null, false) && !$AdminTools->hasPermissions()){ @@ -142,4 +142,4 @@ } break; } -} \ No newline at end of file +}