fix nullsafe warnings

This commit is contained in:
Jean-Christian Paul Denis 2023-04-23 13:54:09 +02:00
parent d8206c992e
commit a5384aaea6
Signed by: JcDenis
GPG Key ID: 1B5B8C5B90B6C951

View File

@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Dotclear\Plugin\postExpired;
use dcAuth;
use dcCore;
use dcNsProcess;
@ -22,8 +21,13 @@ class Backend extends dcNsProcess
{
public static function init(): bool
{
static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->check(
dcCore::app()->auth->makePermissions([dcAuth::PERMISSION_CONTENT_ADMIN]),
static::$init = defined('DC_CONTEXT_ADMIN')
&& !is_null(dcCore::app()->auth) && !is_null(dcCore::app()->blog)
&& dcCore::app()->auth->check(
dcCore::app()->auth->makePermissions(
[
dcCore::app()->auth::PERMISSION_CONTENT_ADMIN]
),
dcCore::app()->blog->id
);