Skip to content

Commit 63a4791

Browse files
authored
PHPC-1720: Move mongoc_client_set_error_api after check for null client pointer (#1197)
1 parent 9c51b70 commit 63a4791

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

php_phongo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3432,13 +3432,14 @@ void phongo_manager_init(php_phongo_manager_t* manager, const char* uri_string,
34323432
#endif
34333433

34343434
manager->client = php_phongo_make_mongo_client(uri, driverOptions);
3435-
mongoc_client_set_error_api(manager->client, MONGOC_ERROR_API_VERSION_2);
34363435

34373436
if (!manager->client) {
34383437
phongo_throw_exception(PHONGO_ERROR_RUNTIME, "Failed to create Manager from URI: '%s'", uri_string);
34393438
goto cleanup;
34403439
}
34413440

3441+
mongoc_client_set_error_api(manager->client, MONGOC_ERROR_API_VERSION_2);
3442+
34423443
#ifdef MONGOC_ENABLE_SSL
34433444
if (ssl_opt) {
34443445
mongoc_client_set_ssl_opts(manager->client, ssl_opt);

0 commit comments

Comments
 (0)