fix npe

fix npe while loading menus