added a meta box to post however when saving menu while debug on throws a warning

Check in your function to save the post meta data for the post type or better for $current_screen. The var is a global and return a object with different identifier to check, in which admin page init the function. Check in your function and return if is not the right $current_screen->id or post_type.

Small hint: use this plugin for easy identify the var.

Also a example for check the current screen and if not the right, then return Null. The follow source is inside a function. But the var have more items inside the array, use the best for your requirement.

global $current_screen;

if ( isset( $current_screen->id ) && 
    'edit.php' === $current_screen->parent_file ) // check, if on edit post type page
 )
 return NULL;

Background: WordPress use the post type and his hooks also on other types, like attachments and nav menu.