@@ -23,7 +23,7 @@ _mongoc_insert_one_opts_parse (
2323{
2424 bson_iter_t iter ;
2525
26- BSON_ASSERT_PARAM (client );
26+ BSON_ASSERT (client || true); // client may be NULL.
2727
2828 mongoc_insert_one_opts -> crud .writeConcern = NULL ;
2929 mongoc_insert_one_opts -> crud .write_concern_owned = false;
@@ -130,7 +130,7 @@ _mongoc_insert_many_opts_parse (
130130{
131131 bson_iter_t iter ;
132132
133- BSON_ASSERT_PARAM (client );
133+ BSON_ASSERT (client || true); // client may be NULL.
134134
135135 mongoc_insert_many_opts -> crud .writeConcern = NULL ;
136136 mongoc_insert_many_opts -> crud .write_concern_owned = false;
@@ -247,7 +247,7 @@ _mongoc_delete_one_opts_parse (
247247{
248248 bson_iter_t iter ;
249249
250- BSON_ASSERT_PARAM (client );
250+ BSON_ASSERT (client || true); // client may be NULL.
251251
252252 mongoc_delete_one_opts -> delete .crud .writeConcern = NULL ;
253253 mongoc_delete_one_opts -> delete .crud .write_concern_owned = false;
@@ -377,7 +377,7 @@ _mongoc_delete_many_opts_parse (
377377{
378378 bson_iter_t iter ;
379379
380- BSON_ASSERT_PARAM (client );
380+ BSON_ASSERT (client || true); // client may be NULL.
381381
382382 mongoc_delete_many_opts -> delete .crud .writeConcern = NULL ;
383383 mongoc_delete_many_opts -> delete .crud .write_concern_owned = false;
@@ -507,7 +507,7 @@ _mongoc_update_one_opts_parse (
507507{
508508 bson_iter_t iter ;
509509
510- BSON_ASSERT_PARAM (client );
510+ BSON_ASSERT (client || true); // client may be NULL.
511511
512512 mongoc_update_one_opts -> update .crud .writeConcern = NULL ;
513513 mongoc_update_one_opts -> update .crud .write_concern_owned = false;
@@ -668,7 +668,7 @@ _mongoc_update_many_opts_parse (
668668{
669669 bson_iter_t iter ;
670670
671- BSON_ASSERT_PARAM (client );
671+ BSON_ASSERT (client || true); // client may be NULL.
672672
673673 mongoc_update_many_opts -> update .crud .writeConcern = NULL ;
674674 mongoc_update_many_opts -> update .crud .write_concern_owned = false;
@@ -829,7 +829,7 @@ _mongoc_replace_one_opts_parse (
829829{
830830 bson_iter_t iter ;
831831
832- BSON_ASSERT_PARAM (client );
832+ BSON_ASSERT (client || true); // client may be NULL.
833833
834834 mongoc_replace_one_opts -> update .crud .writeConcern = NULL ;
835835 mongoc_replace_one_opts -> update .crud .write_concern_owned = false;
@@ -979,7 +979,7 @@ _mongoc_bulk_opts_parse (
979979{
980980 bson_iter_t iter ;
981981
982- BSON_ASSERT_PARAM (client );
982+ BSON_ASSERT (client || true); // client may be NULL.
983983
984984 mongoc_bulk_opts -> writeConcern = NULL ;
985985 mongoc_bulk_opts -> write_concern_owned = false;
@@ -1082,7 +1082,7 @@ _mongoc_bulk_insert_opts_parse (
10821082{
10831083 bson_iter_t iter ;
10841084
1085- BSON_ASSERT_PARAM (client );
1085+ BSON_ASSERT (client || true); // client may be NULL.
10861086
10871087 mongoc_bulk_insert_opts -> validate = _mongoc_default_insert_vflags ;
10881088 bson_init (& mongoc_bulk_insert_opts -> extra );
@@ -1137,7 +1137,7 @@ _mongoc_bulk_update_one_opts_parse (
11371137{
11381138 bson_iter_t iter ;
11391139
1140- BSON_ASSERT_PARAM (client );
1140+ BSON_ASSERT (client || true); // client may be NULL.
11411141
11421142 mongoc_bulk_update_one_opts -> update .validate = _mongoc_default_update_vflags ;
11431143 bson_init (& mongoc_bulk_update_one_opts -> update .collation );
@@ -1245,7 +1245,7 @@ _mongoc_bulk_update_many_opts_parse (
12451245{
12461246 bson_iter_t iter ;
12471247
1248- BSON_ASSERT_PARAM (client );
1248+ BSON_ASSERT (client || true); // client may be NULL.
12491249
12501250 mongoc_bulk_update_many_opts -> update .validate = _mongoc_default_update_vflags ;
12511251 bson_init (& mongoc_bulk_update_many_opts -> update .collation );
@@ -1353,7 +1353,7 @@ _mongoc_bulk_replace_one_opts_parse (
13531353{
13541354 bson_iter_t iter ;
13551355
1356- BSON_ASSERT_PARAM (client );
1356+ BSON_ASSERT (client || true); // client may be NULL.
13571357
13581358 mongoc_bulk_replace_one_opts -> update .validate = _mongoc_default_replace_vflags ;
13591359 bson_init (& mongoc_bulk_replace_one_opts -> update .collation );
@@ -1450,7 +1450,7 @@ _mongoc_bulk_remove_one_opts_parse (
14501450{
14511451 bson_iter_t iter ;
14521452
1453- BSON_ASSERT_PARAM (client );
1453+ BSON_ASSERT (client || true); // client may be NULL.
14541454
14551455 bson_init (& mongoc_bulk_remove_one_opts -> remove .collation );
14561456 memset (& mongoc_bulk_remove_one_opts -> remove .hint , 0 , sizeof (bson_value_t ));
@@ -1527,7 +1527,7 @@ _mongoc_bulk_remove_many_opts_parse (
15271527{
15281528 bson_iter_t iter ;
15291529
1530- BSON_ASSERT_PARAM (client );
1530+ BSON_ASSERT (client || true); // client may be NULL.
15311531
15321532 bson_init (& mongoc_bulk_remove_many_opts -> remove .collation );
15331533 memset (& mongoc_bulk_remove_many_opts -> remove .hint , 0 , sizeof (bson_value_t ));
@@ -1604,7 +1604,7 @@ _mongoc_change_stream_opts_parse (
16041604{
16051605 bson_iter_t iter ;
16061606
1607- BSON_ASSERT_PARAM (client );
1607+ BSON_ASSERT (client || true); // client may be NULL.
16081608
16091609 mongoc_change_stream_opts -> batchSize = 0 ;
16101610 bson_init (& mongoc_change_stream_opts -> resumeAfter );
@@ -1747,7 +1747,7 @@ _mongoc_create_index_opts_parse (
17471747{
17481748 bson_iter_t iter ;
17491749
1750- BSON_ASSERT_PARAM (client );
1750+ BSON_ASSERT (client || true); // client may be NULL.
17511751
17521752 mongoc_create_index_opts -> writeConcern = NULL ;
17531753 mongoc_create_index_opts -> write_concern_owned = false;
@@ -1823,7 +1823,7 @@ _mongoc_read_write_opts_parse (
18231823{
18241824 bson_iter_t iter ;
18251825
1826- BSON_ASSERT_PARAM (client );
1826+ BSON_ASSERT (client || true); // client may be NULL.
18271827
18281828 bson_init (& mongoc_read_write_opts -> readConcern );
18291829 mongoc_read_write_opts -> writeConcern = NULL ;
@@ -1931,7 +1931,7 @@ _mongoc_gridfs_bucket_opts_parse (
19311931{
19321932 bson_iter_t iter ;
19331933
1934- BSON_ASSERT_PARAM (client );
1934+ BSON_ASSERT (client || true); // client may be NULL.
19351935
19361936 mongoc_gridfs_bucket_opts -> bucketName = "fs" ;
19371937 mongoc_gridfs_bucket_opts -> chunkSizeBytes = 261120 ;
@@ -2028,7 +2028,7 @@ _mongoc_gridfs_bucket_upload_opts_parse (
20282028{
20292029 bson_iter_t iter ;
20302030
2031- BSON_ASSERT_PARAM (client );
2031+ BSON_ASSERT (client || true); // client may be NULL.
20322032
20332033 mongoc_gridfs_bucket_upload_opts -> chunkSizeBytes = 0 ;
20342034 bson_init (& mongoc_gridfs_bucket_upload_opts -> metadata );
@@ -2099,7 +2099,7 @@ _mongoc_aggregate_opts_parse (
20992099{
21002100 bson_iter_t iter ;
21012101
2102- BSON_ASSERT_PARAM (client );
2102+ BSON_ASSERT (client || true); // client may be NULL.
21032103
21042104 mongoc_aggregate_opts -> readConcern = NULL ;
21052105 mongoc_aggregate_opts -> writeConcern = NULL ;
@@ -2263,7 +2263,7 @@ _mongoc_find_and_modify_appended_opts_parse (
22632263{
22642264 bson_iter_t iter ;
22652265
2266- BSON_ASSERT_PARAM (client );
2266+ BSON_ASSERT (client || true); // client may be NULL.
22672267
22682268 mongoc_find_and_modify_appended_opts -> writeConcern = NULL ;
22692269 mongoc_find_and_modify_appended_opts -> write_concern_owned = false;
@@ -2372,7 +2372,7 @@ _mongoc_count_document_opts_parse (
23722372{
23732373 bson_iter_t iter ;
23742374
2375- BSON_ASSERT_PARAM (client );
2375+ BSON_ASSERT (client || true); // client may be NULL.
23762376
23772377 bson_init (& mongoc_count_document_opts -> readConcern );
23782378 mongoc_count_document_opts -> client_session = NULL ;
0 commit comments