mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
fix npe in fix
This commit is contained in:
parent
a4a3d19ce1
commit
767d576ca4
@ -710,11 +710,13 @@ namespace mongo {
|
||||
assert( JS_SetProperty( cx , obj , s.c_str() , &val ) );
|
||||
holder->_inResolve = false;
|
||||
|
||||
if ( JSVAL_IS_OBJECT( val ) &&
|
||||
( JS_InstanceOf( cx , JSVAL_TO_OBJECT( val ) , &bson_class , 0 ) ||
|
||||
JS_IsArrayObject( cx , JSVAL_TO_OBJECT( val ) ) ) ){
|
||||
if ( val != JSVAL_NULL && val != JSVAL_VOID && JSVAL_IS_OBJECT( val ) ){
|
||||
// TODO: this is a hack to get around sub objects being modified
|
||||
holder->_modified = true;
|
||||
JSObject * oo = JSVAL_TO_OBJECT( val );
|
||||
if ( JS_InstanceOf( cx , oo , &bson_class , 0 ) ||
|
||||
JS_IsArrayObject( cx , oo ) ){
|
||||
holder->_modified = true;
|
||||
}
|
||||
}
|
||||
|
||||
*objp = obj;
|
||||
|
Loading…
Reference in New Issue
Block a user