Does anyone know if the IsNullOrEmpty bug has been fixed in version 3.0 or later? Currently, I encountered a (NullReferenceException) error in version 2.0, and I found documentation that should be fixed in the next version, but there is no final answer.
I found info on this:
This error has been fixed in Microsoft .NET Framework 2.0 Service Pack 1 (SP1).
Works with .NET 3.5SP1. Testing program for those who want to try (mainly from the error report):
using System; class Test { static void Main(string[] args) { Console.WriteLine("starting"); ShowBug(null); Console.WriteLine("finished"); Console.ReadLine(); } static void ShowBug(string x) { for (int j = 0; j < 10; j++) { if (String.IsNullOrEmpty(x)) { //TODO: } } } }
/o +/debug- .
Microsoft reported this error as fixed on the Connect website . If you can still reproduce the problem, I recommend that you resubmit the regression.
I think it depends on where you came across this error. If you encounter it in the table adapter, for example, this is because the properties themselves are configured to return this exception when the value is null.