mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
don't require constructor to be set SERVER-1118
This commit is contained in:
parent
2e73b896a0
commit
2dbdcf9e4c
@ -647,7 +647,7 @@ tojsonObject = function( x, indent , nolint ){
|
||||
return x.tojson(indent,nolint);
|
||||
}
|
||||
|
||||
if ( typeof( x.constructor.tojson ) == "function" && x.constructor.tojson != tojson ) {
|
||||
if ( x.constructor && typeof( x.constructor.tojson ) == "function" && x.constructor.tojson != tojson ) {
|
||||
return x.constructor.tojson( x, indent , nolint );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user