MDL-62294 lessphp: Fix for PHP 7.2 compatibility
[moodle.git] / lib / lessphp / Visitor / toCSS.php
index 18d328f..8aaca96 100644 (file)
@@ -110,7 +110,7 @@ class Less_Visitor_toCSS extends Less_VisitorReplacing{
 
 
                // Compile rules and rulesets
-               $nodeRuleCnt = count($rulesetNode->rules);
+               $nodeRuleCnt = $rulesetNode->rules?count($rulesetNode->rules):0;
                for( $i = 0; $i < $nodeRuleCnt; ){
                        $rule = $rulesetNode->rules[$i];