diff --git a/src/Frontend.php b/src/Frontend.php index a04b23f..fc8227d 100644 --- a/src/Frontend.php +++ b/src/Frontend.php @@ -36,6 +36,11 @@ class Frontend extends dcNsProcess dcCore::app()->addBehaviors([ // template path 'publicBeforeDocumentV2' => function (): void { + // nullsafe PHP < 8.0 + if (is_null(dcCore::app()->blog)) { + return ; + } + $tplset = dcCore::app()->themes->moduleInfo(dcCore::app()->blog->settings->get('system')->get('theme'), 'tplset'); if (!empty($tplset) && is_dir(implode(DIRECTORY_SEPARATOR, [My::root(), 'default-templates', $tplset]))) { dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), implode(DIRECTORY_SEPARATOR, [My::root(), 'default-templates', $tplset])); diff --git a/src/Widgets.php b/src/Widgets.php index 048b2cf..b562ca9 100644 --- a/src/Widgets.php +++ b/src/Widgets.php @@ -44,6 +44,11 @@ class Widgets return ''; } + // nullsafe PHP < 8.0 + if (is_null(dcCore::app()->blog)) { + return ''; + } + return $w->renderDiv( (bool) $w->content_only, My::id() . ' ' . $w->class,