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))) {