diff --git a/libraries/cms/component/router/base.php b/libraries/cms/component/router/base.php index a75a5924892c9..a12f5c2a9ae16 100644 --- a/libraries/cms/component/router/base.php +++ b/libraries/cms/component/router/base.php @@ -42,23 +42,19 @@ abstract class JComponentRouterBase implements JComponentRouterInterface */ public function __construct($app = null, $menu = null) { - if ($app) + if (is_null($app)) { - $this->app = $app; - } - else - { - $this->app = JFactory::getApplication(); + $app = JFactory::getApplication(); } - if ($menu) - { - $this->menu = $menu; - } - else + $this->app = $app; + + if (is_null($menu)) { - $this->menu = $this->app->getMenu(); + $menu = $this->app->getMenu(); } + + $this->menu = $menu; } /**