-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.1.2
-
Component/s: None
-
None
Currently, MongoDB\BSON\toJSON() only throws if we cannot read exactly one document from the input stream.
Corrupt BSON (e.g. flipping a field's type to the wrong byte) causes bson_as_json() to return NULL, which we simply return as an empty string. Instead, we should check for NULL and raise an exception.