There is a rather poorly formed question that probably should be closed. However, there is an answer that states:
Fix the programming bug.
Once you do baseline debugging the error will become clear. And this is a skill you rather pick up now - most of programming time is spent debugging.
Go through the code step by step with your debugger. Look at all the variables. Look at the input variables the moment the error appears. Fix them.
Am I in the right to say this isn't an answer?
It may well be a poor question, but "go off and debug" doesn't strike me as an answer to it. Of course, if we all did our own research there would be no need for SO at all.
Then the only answer that does attempt to deal with the question has been downvoted. Yet, that answer does seem to deal with the (poor) question. Okay, so it needs a sentence of explanation. TomTom left the following comment on it:
"It is copy/paste code without a single line of explanation. "Do not use your brain, do not understand the bug, just copy paste and do not think".
This strikes me as a little abusive and vindictive, that such a (seemingly) basic code problem has been asked in the first place. But he is a 40k user, so I thought I'd ask here...