Is variable assignment expensive compared to a null check? For example, is it worth checking that foo is not null before assigning it null?
if (foo != null)
This will make your code so much harder to read that even if it was an optimization it wouldn't be worth the trouble.
And it's not an optimization. On most modern cpu's if statements are quite expensive.