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

ObjectId.TryParse shouldn't throw an exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.0, 1.4.1
    • Fix Version/s: 1.1, 1.5
    • Component/s: None
    • Labels:
    • Environment:
      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

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: