views:

399

answers:

4

Does anyone know if the IsNullOrEmpty bug is fixed in 3.0 or later? I currently came across the (NullReferenceException) bug in 2.0 and I have found documentation stating that is supposed to be fixed in the next release, but no definitive answer.

+10  A: 

I found some info on the matter:

This bug has been fixed in the Microsoft .NET Framework 2.0 Service Pack 1 (SP1).

bruno conde
+4  A: 

Works with .NET 3.5SP1. Test program for those who want to try it (mostly taken from bug 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:
            }
        }
    }
}

Compile with /o+ /debug- from the command line.

Jon Skeet
+1  A: 

Microsoft has reported this bug as fixed on the Connect site. If you can still repro the issue, I encourage you to resubmit the regression.

Greg D
A: 

I think it depends on where you came across this bug also. If you encountered it in a table adapter for instance it is because the properties themselves are set to return that exception when a value is null.