Throw an exception while the list is empty