I have this code to render the menu. I need to make extensive modifications of the elements, so this is why I extract it in this way (multidomain-multilanguage site, I tried everything and this was the only solution I found):
$a = menu_tree_output( menu_tree_page_data("main-menu") )
It works perfectly and $a is an array full of content. Works for every page, except for 404 not found pages. There it returns an empty array.
Any help would be appreciated. I was thinking of storing the menus for the different languages and domains in the database in a personal table and checking if array is empty, in order to extract the info, but I think that is not a good solution. Thank you!!!