Manage empty item in item_list theme
You simply need to run array_filter on $items - this will remove the empty entries. 

Whether this should be handled by theme_item_list or not is debatable. It doesn't make semantic sense to theme empty list items - however in most cases the filtering would not be necessary, so from a performance point of view it doesn't make sense for theme_item_list to do it.