can return null, so this is the first candidate for this exception. Please see:
Also, you did not show the code for
, so I cannot tell if the exception is there. Or anywhere else.
Not to worry. This kind of exception is easiest to detect. You just need to use the debugger. When the exception is thrown, put a break point on this like and run the application again. The execution will be stopped at the point where the exception is about to throw, just before it happens. Examine every value used in next line. The reason of the exception is that some value which is not supposed to be null is actually null. You will find it in no time.
Generally, you need to use the debugger before asking questions like this one. Actually, you need to use the debugger in case of slightest concern about your run time behavior.