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

NullReferenceException on Find() operation.

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Blocker - P1 Blocker - P1
    • None
    • 2.0
    • BSON
    • Windows 7, MS Visual Studio 2013, MongoServer v2.4.6, MongoDriver v2.0

    Description

      I installed mongocsharpdriver v2.0, but on one operation in my project:
      ...
      var query1 = Query.EQ();
      var query2 = Query.EQ();
      var query3 = Query.In();
      var query4 = Query.EQ();
      var query5 = Query.EQ();
      var query6 = Query.Or(query4, query5);
      var queryAll = Query.And(query1, query2, query3, query6);
      var result = Collection.FindOne(queryAll);
      ...

      i catched exception:
      An exception of type 'System.NullReferenceException' occurred in MongoDB.Bson.dll but was not handled in user code
      Additional information: Object reference not set to an instance of an object.

      But, if i changed this operation like this:
      var result = Collection.Count(queryAll); - worked well.

      Also, this operation working properly on driver version 1.8 and version 1.10.
      What could it be?

      Attachments

        1. Example Code.rar
          12.53 MB
        2. stacktrace.txt
          2 kB

        Activity

          People

            Unassigned Unassigned
            mtred mtred
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: