0
0
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:
Eliot Horowitz 2009-07-23 18:58:32 -04:00
parent a4a3d19ce1
commit 767d576ca4

View File

@ -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;