From 5aab2c544122a05366c538b7b5f82d722d0648ca Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 30 Jan 2025 09:29:17 +0100 Subject: [PATCH] fix PHP error: count(): Argument #1 ($value) must be of type Countable|array, null given --- api/src/Etemplate/Widget/Template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Template.php b/api/src/Etemplate/Widget/Template.php index 34db765e32..718ac4e3ab 100644 --- a/api/src/Etemplate/Widget/Template.php +++ b/api/src/Etemplate/Widget/Template.php @@ -253,7 +253,7 @@ class Template extends Etemplate\Widget } //error_log("$this running $method_name() cname: {$this->id} -> expand_name: $expand_name"); // Expand if it's different, or it hasn't been expanded yet (no children, and the template actually has children) - if($expand_name && ($expand_name != $this->id || count($this->children) == 0 && count(static::$cache[$expand_name]->children) > 0)) + if($expand_name && ($expand_name != $this->id || count($this->children ?? []) == 0 && count(static::$cache[$expand_name]->children ?? []) > 0)) { if (($row_template = self::instance($expand_name))) {