fixed #508 (don’t popup empty menus)

thanks, @cycomached!