Notice: Trying to get property 'name' of non-object

Stacktrace:
#0 => CategoryController->detail @ /var/www/vhosts/editorialcep.com/public_html/bo/bo.router.php:159
#1 => Router->route @ /var/www/vhosts/editorialcep.com/public_html/bo/bo.php:129
#2 => boApp->run @ /var/www/vhosts/editorialcep.com/public_html/index.php:75

Fatal error: Uncaught Error: Call to a member function getLevel() on null in /var/www/vhosts/editorialcep.com/public_html/controllers/CategoryController.php:38 Stack trace: #0 /var/www/vhosts/editorialcep.com/public_html/bo/bo.router.php(159): CategoryController->detail('176', 'oposiciones') #1 /var/www/vhosts/editorialcep.com/public_html/bo/bo.php(129): Router->route('oposiciones/20-...') #2 /var/www/vhosts/editorialcep.com/public_html/index.php(75): boApp->run() #3 {main} thrown in /var/www/vhosts/editorialcep.com/public_html/controllers/CategoryController.php on line 38