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

ObjectId.TryParse shouldn't throw an exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • 1.0, 1.4.1
    • 1.1, 1.5
    • None
    • Windows 2008 + MongoDb 1.8.1 + C# Driver 1.0

    Description

      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?

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: