Skip to content

Commit c0ca587

Browse files
committed
CDRIVER-1922 assert err in stream_not_found
1 parent 751c853 commit c0ca587

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/mongoc/mongoc-cluster.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,18 +1467,17 @@ stream_not_found (mongoc_topology_t *topology,
14671467
{
14681468
mongoc_server_description_t *sd;
14691469

1470-
BSON_ASSERT (error);
1471-
14721470
sd = mongoc_topology_server_by_id (topology, server_id, error);
14731471

1474-
if (sd && sd->error.code) {
1475-
memcpy (error, &sd->error, sizeof *error);
1476-
} else {
1477-
bson_set_error (error,
1478-
MONGOC_ERROR_STREAM,
1479-
MONGOC_ERROR_STREAM_NOT_ESTABLISHED,
1480-
"Could not find stream for node %s",
1481-
connection_address);
1472+
if (error) {
1473+
if (sd && sd->error.code) {
1474+
memcpy (error, &sd->error, sizeof *error);
1475+
} else {
1476+
bson_set_error (error, MONGOC_ERROR_STREAM,
1477+
MONGOC_ERROR_STREAM_NOT_ESTABLISHED,
1478+
"Could not find stream for node %s",
1479+
connection_address);
1480+
}
14821481
}
14831482

14841483
if (sd) {

0 commit comments

Comments
 (0)