From 15ff397ff2f9ce084d1ebbe7b1bd273a8d658f1f Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sat, 22 Apr 2023 14:59:05 +0200 Subject: [PATCH] fix nullsafe warnings --- src/Widgets.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Widgets.php b/src/Widgets.php index 4535f19..74a1f98 100644 --- a/src/Widgets.php +++ b/src/Widgets.php @@ -135,18 +135,14 @@ class Widgets public static function frontendWidget(WidgetsElement $w): string { + if (is_null(dcCore::app()->blog) || $w->offline || !$w->checkHomeOnly(dcCore::app()->url->type)) { + return ''; + } + $content = $addons = ''; $s_line = '
  • %s%s
  • '; $s_title = '%s '; - if ($w->offline) { - return ''; - } - - if (!$w->checkHomeOnly(dcCore::app()->url->type)) { - return ''; - } - # Entry if ($w->entry_show) { $title = $w->entry_title ?