Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-959

Do not check for null return from mongoc_collection_find_with_opts()

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3.0-beta1, 1.3.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Quoting jesse in CDRIVER-1110:

      By the way I notice a "FIXME" in Phongo to deal with a NULL return from mongoc_collection_find_with_opts – that can never happen, mongoc_collection_find_with_opts always returns a cursor.

      Remove the following code from phongo_execute_query():

      /* mongoc issues a warning we need to catch somehow */
      if (!cursor) {
          phongo_throw_exception(PHONGO_ERROR_MONGOC_FAILED TSRMLS_CC, "%s", "FIXME: Couldn't create cursor...");
          return false;
      }
      

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: