Check menu item is not null

Could be the beginning or the end of the menu

Refs #144