Catches NoSuchElementException from input scanner