The problem is that a Null string cannot be converted to a number. For secondvalue(1) to be null either the code to set it has not been executed, or no item in listsecond was selected when the assignment was made.