Skip to content

Commit 5fc10a9

Browse files
yhageramidvidy
authored andcommitted
CXX-587: validate an element before printing it as json string
Signed-off-by: Adam Midvidy <amidvidy@gmail.com>
1 parent 050b881 commit 5fc10a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bsoncxx/json.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ class json_visitor {
216216
void visit_children(const document::view& view) {
217217
bool first = true;
218218
for (auto&& x : view) {
219+
if (!x) {
220+
break;
221+
}
219222
if (!first) {
220223
out << ", " << std::endl;
221224
}

0 commit comments

Comments
 (0)