Using module_invoke for Menu causes Undefined index notice I'm displaying a multi-level menu in the footer of my site using:

$block = module_invoke('menu', 'block_view', 'main-menu');
          print render($block['content']);


Which is displaying correctly, however I am receiving this warning message:


  Notice: Undefined index: main-menu in menu_block_view() (line 486 of /****/modules/menu/menu.module).


Any suggestions on how to suppress this message?
It is caused from the following line, executed from menu_block_view().

$data['subject'] = check_plain($menus[$delta]);


$delta is the value you pass as last argument to module_invoke().

It means there isn't any menu with that ID, or you misspelled the menu ID. Try with main_menu, for example.