I have a program that is command line based, in which when they enter a command "echo" it buffer writes the words after echo to a file called "talkfile" (this code is omited).

I have chosen the limit to be 100 words. However the user can randomly write anything up to that. The talkfile.write should write all non-null values in the array. When I run this, I get a null pointer error. How can I fix this?

```
String[] inputSplit =  input.split(" ");
switch (inputSplit[0]) {  
case "echo" :
    for (int i = 0; i < inputSplit.length; i++)
    { 
        if (inputSplit[i] == null)
        talkfile.write(inputSplit[1-100]);
        }

     sysOut(talkfile.read());

break;
}

```