Checked for data before calling getline on input stream