yes, it throw exception, but in general you can and should check if lines are empty before this method as swap lines should not be empty as it always have header