diff --git a/gulliver/system/class.templatePower.php b/gulliver/system/class.templatePower.php index f3c2c4c6f..11d361b1d 100644 --- a/gulliver/system/class.templatePower.php +++ b/gulliver/system/class.templatePower.php @@ -605,7 +605,7 @@ class TemplatePower extends TemplatePowerParser public function newBlock($blockname) { $parent = &$this->content[$this->parent[$blockname] . '_' . $this->index[$this->parent[$blockname]]]; - $lastitem = sizeof($parent); + $lastitem = !is_null($parent) ? sizeof($parent) : 0; $lastitem > 1 ? $lastitem-- : $lastitem = 0; $ind_blockname = $blockname . '_' . $this->index[$blockname]; if (!isset($parent[$lastitem]["_B:$blockname"])) {