I am attempting to read from a file - my code is below:

```
try 
    {
        Scanner inFile = new Scanner (new FileReader("input.txt"));

        while(inFile.hasNextLine()) 
        {
            first = inFile.next();
            second = inFile.next();
            System.out.println("first: " + first);
            System.out.println("second: " + second);

        }

        inFile.close();    

    }
    catch(FileNotFoundException exception)
    {
        System.out.println("Unable to locate file");
    }

```

The file text is:

```
Fred 10
John 13
Bob
Jill 43

```

Because some lines do not contain any text the program crashes. For example, this program crashes when it tries to give "second" a value in the third line - the one containing Bob.

How can I create an if value exists? Or ignore if no value?