@@ -477,7 +477,11 @@ static void add_next_index_node(zval *array, mongoc_cluster_node_t *node)
477
477
add_assoc_long_ex (data , ZEND_STRS ("min_wire_version" ), node -> min_wire_version );
478
478
add_assoc_long_ex (data , ZEND_STRS ("max_wire_version" ), node -> max_wire_version );
479
479
add_assoc_long_ex (data , ZEND_STRS ("max_write_batch_size" ), node -> max_write_batch_size );
480
- add_assoc_string_ex (data , ZEND_STRS ("replSet" ), node -> replSet , 0 );
480
+ if (node -> replSet ) {
481
+ add_assoc_string_ex (data , ZEND_STRS ("replSet" ), node -> replSet , 0 );
482
+ } else {
483
+ add_assoc_null_ex (data , ZEND_STRS ("replSet" ));
484
+ }
481
485
add_assoc_long_ex (data , ZEND_STRS ("last_read_msec" ), node -> last_read_msec );
482
486
bson_to_zval (bson_get_data (& node -> tags ), node -> tags .len , & state );
483
487
add_assoc_zval_ex (data , ZEND_STRS ("tags" ), state .zchild );
@@ -514,7 +518,8 @@ HashTable *php_phongo_manager_get_debug_info(zval *object, int *is_temp TSRMLS_D
514
518
add_assoc_long_ex (cluster , ZEND_STRS ("last_reconnect" ), intern -> client -> cluster .last_reconnect );
515
519
add_assoc_string_ex (cluster , ZEND_STRS ("uri" ), (char * )mongoc_uri_get_string (intern -> client -> cluster .uri ), 0 );
516
520
add_assoc_long_ex (cluster , ZEND_STRS ("requires_auth" ), intern -> client -> cluster .requires_auth );
517
- {
521
+
522
+ if (intern -> client -> cluster .nodes_len ) {
518
523
zval * nodes = NULL ;
519
524
unsigned int i ;
520
525
0 commit comments