Just want to be sure that I haven't been coding for too long ... But, this seems highly unlikely :
https://i.stack.imgur.com/mTlwX.png
I create the var, check for null, return if it is, so there's no way I can see it as being null at that point :)
Resharper bug ?
Edit:
As per Igal Tabachnik answer, he's right, I'm using the following method extension:
public static bool IsNullOrEmpty(this string target)
{
return String.IsNullOrEmpty(target);
}
I find it much easier to read
if (some_string.IsNullOrEmpty())
// do something here
rather than the:
if (string.IsNullOrEmpty(some_string))
// do something here
Solution:
Igal Tabachnik was right. The only 2 missing pieces were:
- Resharper -> Options -> Code Annotations (under Code inspection group) -> turn on for solution.
- Give VS a couple of minutes to get refresh everything.