Resharper don't consider null check of String.IsNullOrWhiteSpace
Resharper doesn't correct handle the String.IsNullOrWhiteSpace check for a string.
The code abode
string line = this._reader.ReadLine();
if (String.IsNullOrWhiteSpace(line))
{
break;
}
var splitLine = line.Split(new[] { ':' }, 2);
Resharper tell me about a null reference exception when accessing the line variable in line 8. If I change the method to use String.IsNullOrEmpty, the possible null reference exception warning doesn't apear.
Please sign in to leave a comment.
Hello Sergio,
Thank you for reporting this problem! There's a bug-report in our bug-tracker:
http://youtrack.jetbrains.net/issue/RSRP-186427 and this problem will be
fixed in the next major ReSharper release.
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"