From dcd47d58bea3e044f7374c4c7b79df7b0060e85e Mon Sep 17 00:00:00 2001 From: Cyssoo Date: Wed, 4 Mar 2026 16:55:29 +0100 Subject: [PATCH] Guard null controller in shortcode rendering --- src/Service/EverblockTools.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Service/EverblockTools.php b/src/Service/EverblockTools.php index 5579429..112d8e9 100644 --- a/src/Service/EverblockTools.php +++ b/src/Service/EverblockTools.php @@ -158,7 +158,11 @@ public static function renderShortcodes(string $txt, Context $context, Everblock $callArgs = array_merge([$txt], static::resolveShortcodeArgs($args, $context, $module)); $txt = forward_static_call_array([static::class, $method], $callArgs); } - if (in_array($context->controller->controller_type, $controllerTypes)) { + $controllerType = is_object($context->controller) && isset($context->controller->controller_type) + ? $context->controller->controller_type + : null; + + if ($controllerType !== null && in_array($controllerType, $controllerTypes, true)) { $txt = static::getCustomerShortcodes($txt, $context); $txt = static::obfuscateTextByClass($txt); }