Check line is empty or not before getting line of character