diff --git a/Contrib/less.php/Less.php b/Contrib/less.php/Less.php index b595c00ed..32ad49225 100644 --- a/Contrib/less.php/Less.php +++ b/Contrib/less.php/Less.php @@ -9332,7 +9332,7 @@ public function visitRuleset( $rulesetNode, &$visitDeeper ){ // Compile rules and rulesets - $nodeRuleCnt = count($rulesetNode->rules); + $nodeRuleCnt = (is_array($rulesetNode->rules) || $rulesetNode->rules instanceof Countable) ? count($rulesetNode->rules) : 0; for( $i = 0; $i < $nodeRuleCnt; ){ $rule = $rulesetNode->rules[$i];