Skip to content

Commit

Permalink
fix PHP error: count(): Argument #1 ($value) must be of type Countabl…
Browse files Browse the repository at this point in the history
…e|array, null given
  • Loading branch information
ralfbecker committed Jan 30, 2025
1 parent bea41b1 commit 5aab2c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/Etemplate/Widget/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function run($method_name, $params=array(''), $respect_disabled=false)
}
//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)))
{
Expand Down

0 comments on commit 5aab2c5

Please sign in to comment.