erdmannfreunde/contao-onepage-navigation

Pages without articles will cause an Exception

Closed this issue · 0 comments

If you have the onepage-navigation (without reference-page) in layout but the page has no articles - the site will crash with following exception:

request.CRITICAL: Uncaught PHP Exception Error: "Call to a member function next() on null" at /var/www/vhosts/xxx/vendor/erdmannfreunde/onepage-navigation/src/Modules/ModuleOnepageNavigation.php line 74 {"exception":"[object] (Error(code: 0): Call to a member function next() on null at /var/www/vhosts/xxx/vendor/erdmannfreunde/onepage-navigation/src/Modules/ModuleOnepageNavigation.php:74)"} [] 

It would be nice if that could be catched somehow - it works flawlessly if there is just one unpublished article.