Added check if menu is empty to fix JS error when it is.
Merge pull request #2 from gilshwartz/bug_fix_empty_menu

Added check if menu is empty to fix JS error when it is.