lessphp
lessphp copied to clipboard
Undefined property: stdClass::$parent
lessc.inc.php (2056): Undefined property: stdClass::$parent
This issue is caused by a superflous closing curled bracket, in that case $this->env
has no parent
property.
I've fixed this issue by appending an additional check to properly throw an exception rather than raising a PHP error.
old:
if (!is_null($this->env->parent))
new:
if (!property_exists($this->env, 'parent') || !is_null($this->env->parent))
This fix appears to work for me!
I'm using this library via the LESS Drupal module; so my steps to reproduce are:
- Click the
Flush LESS Files
button atadmin/config/development/less
- Load a page.
- Check the log messages at
admin/reports/dblog
.
You can also change new stdclass; to new \stdclass();