What variable has a null value? Print out the variables on the line with the error.
Why doesn't the variable have a valid non-null value? Backtrack in the code to see.