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 is actually (very, very slightly) less efficient. Variable assignments are roughly equivalent to null checks, plus there's an extra branch possible. Not that it makes much difference.
Or is this worrying about nothing?
You got it.