Fixes #6379: Makes sure that page menu items exist before trying to prepare them for viewing

Makes sure that the page menu in admin context has not been modified before trying to prepare it for viewing

Fixes #6379