[Solved] Check if null before set to null?


No, there is not much use. Probably checking the variable being null or not is just as expensive as setting it to null one time too many.

If it was a property, with additional logic behind it, it could make sense to test it before, but that should actually be the responsibility of the logic in the property, not your code.

4

solved Check if null before set to null?