snowair / phalcon-debugbar

A powerful debug and profilers tool for the Phalcon Framework
MIT License
162 stars 49 forks source link

[BUG] get_class() expects parameter 1 to be object #56

Closed OrangeTanguine closed 5 years ago

OrangeTanguine commented 5 years ago

With PHP7.0.30, we have a warning bug : ( ! ) Warning: get_class() expects parameter 1 to be object, null given in /usr/share/nginx/html/projectname/vendor/snowair/phalcon-debugbar/src/DataCollector/RouteCollector.php on line 59

Bug Line : $result['Controller'] = get_class( $controller_instance = $dispatcher->getActiveController());

Fix : $result['Controller'] = $dispatcher->getActiveController() != null ? get_class( $controller_instance = $dispatcher->getActiveController()) : $controller_instance ="";