fix nullsafe warning
This commit is contained in:
parent
9a486b63a8
commit
890ef25307
@ -52,7 +52,9 @@ class Backend extends dcNsProcess
|
|||||||
|
|
||||||
public static function init(): bool
|
public static function init(): bool
|
||||||
{
|
{
|
||||||
static::$init = defined('DC_CONTEXT_ADMIN') && dcCore::app()->auth->isSuperAdmin();
|
static::$init = defined('DC_CONTEXT_ADMIN')
|
||||||
|
&& !is_null(dcCore::app()->auth)
|
||||||
|
&& dcCore::app()->auth->isSuperAdmin();
|
||||||
|
|
||||||
return static::$init;
|
return static::$init;
|
||||||
}
|
}
|
||||||
@ -75,6 +77,11 @@ class Backend extends dcNsProcess
|
|||||||
) : '';
|
) : '';
|
||||||
},
|
},
|
||||||
'adminModulesListDoActions' => function (adminModulesList $list, array $modules, string $type): void {
|
'adminModulesListDoActions' => function (adminModulesList $list, array $modules, string $type): void {
|
||||||
|
# nullsafe
|
||||||
|
if (is_null(dcCore::app()->blog)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
# Pack action
|
# Pack action
|
||||||
if (empty($_POST[self::id()])
|
if (empty($_POST[self::id()])
|
||||||
|| !is_array($_POST[self::id()])) {
|
|| !is_array($_POST[self::id()])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user