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

ObjectId.TryParse shouldn't throw an exception

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.1, 1.5
    • Affects Version/s: 1.0, 1.4.1
    • Component/s: None
    • Labels:
    • Environment:
      Windows 2008 + MongoDb 1.8.1 + C# Driver 1.0

      Currently ObjectId.TryParse(string s, out ObjectId o) checks for null value and throws an exception if it's null. That is not how TryParse is implemented elsewhere - it should simply initialize o = ObjectId.Empty and return false - the whole idea of using TryParse is that it doesn't throw exceptions.

      Can you please fix that?

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

              Created:
              Updated:
              Resolved: