Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-507

System.NullReferenceException on Empty String comparison

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.6
    • Affects Version/s: 1.5
    • Component/s: None
    • Labels:

      The following code gives us a NullReferenceException in FirstOrDefault() implementation:

      collection.AsQueryable().Where(d => d.StringField == String.Empty).Select(d => d.SomeField).FirstOrDefault()

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            zaidmasud Zaid Masud
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: