Checking sender for null

M

mick

Been playing around with ReSharper for a couple of days and noticed that
it prompts me to check sender for null in handlers. This is something I don't
usually do but wondered if it was possible for sender to be null? What do the
more experienced programmers amongst you do?

mick
 
M

mick

"Peter Duniho" wrote in message

Been playing around with ReSharper for a couple of days and noticed that
it prompts me to check sender for null in handlers. This is something I don't
usually do but wondered if it was possible for sender to be null? What do the
more experienced programmers amongst you do?
It depends on the event implementor, but it's definitely possible in theory
for "sender" to be null. The parameter is just another argument passed by...
<snip>

Thanks for taking the time to reply Pete.

mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top