Calling extension method on a null instance
I had a junior developer commenting on a PR that it’s missing a null check before calling an extension method on a string as the string can be null and it would throw a null reference exception. This results in an interesting discussion among the developers. Let’s say the extension method looks something like this. … [Read more…]