Avoid crashes with submenus in ContextMenus.

We should return properly submenu, instead of a null ptr.

Reviewed By: Hugo Parente Lima