From 4afb4d73c2228f49a9c5192057532612527c1c59 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 1 May 2023 01:10:24 +0200 Subject: [PATCH] fix nullsafe warning --- src/My.php | 4 +++- src/Prepend.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/My.php b/src/My.php index d753ba2..f20e01a 100644 --- a/src/My.php +++ b/src/My.php @@ -37,6 +37,8 @@ class My */ public static function name(): string { - return __((string) dcCore::app()->plugins->moduleInfo(self::id(), 'name')); + $name = dcCore::app()->plugins->moduleInfo(self::id(), 'name'); + + return __(is_string($name) ? $name : self::id()); } } diff --git a/src/Prepend.php b/src/Prepend.php index a6237d6..1d1eedb 100644 --- a/src/Prepend.php +++ b/src/Prepend.php @@ -64,7 +64,7 @@ class Prepend extends dcNsProcess } // Use visible redirection - if ($redir) { + if ($redir && !is_null(dcCore::app()->blog)) { Http::redirect(dcCore::app()->blog->url . $part); }