diff --git a/lib/Templating/Renderer/IncludeRenderer.php b/lib/Templating/Renderer/IncludeRenderer.php index 8eb556161fb..d6f11f86c19 100644 --- a/lib/Templating/Renderer/IncludeRenderer.php +++ b/lib/Templating/Renderer/IncludeRenderer.php @@ -91,7 +91,7 @@ public function render(mixed $include, array $params = [], bool $editmode = fals }); // TODO is this enough for cache or should we disable caching completely? - if (method_exists($include, 'getUseTargetGroup') && $include->getUseTargetGroup()) { + if (is_object($include) && method_exists($include, 'getUseTargetGroup') && $include->getUseTargetGroup()) { $cacheParams['target_group'] = $include->getUseTargetGroup(); }