Skip to content

Commit 1b4e5ac

Browse files
committed
Bail out when we cannot connect to the server!
1 parent 4635cf8 commit 1b4e5ac

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

php_phongo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ mongoc_stream_t* phongo_stream_initiator(const mongoc_uri_t *uri, const mongoc_h
790790
stream = php_stream_xport_create(dsn, dsn_len, 0, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, (char *)"persistent id", /*options->connectTimeoutMS*/0, (php_stream_context *)NULL, &errmsg, &errcode);
791791
if (!stream) {
792792
bson_set_error (error, MONGOC_ERROR_STREAM, MONGOC_ERROR_STREAM_CONNECT, "Failed connecting to '%s:%d': %s", host->host, host->port, errmsg);
793+
return NULL;
793794
}
794795
if (enable_ssl) {
795796
zend_error_handling error_handling;

0 commit comments

Comments
 (0)