You need to test if the textfields have values before you try to use them.
Get the contents of each text field and test that there is good data before using it.
Use an if statement to test the...