mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Deal with NULL object case before asking if its an object
This commit is contained in:
parent
ae05f5bb1b
commit
ba6ad21987
@ -453,16 +453,16 @@ static const char *kSetCaseNonPrimaryStr =
|
||||
|
||||
|
||||
static const char *kObjectSetCaseStr =
|
||||
" if (JSVAL_IS_OBJECT(*vp)) {\n"
|
||||
" if (JSVAL_IS_NULL(*vp)) {\n"
|
||||
" prop = nsnull;\n"
|
||||
" }\n"
|
||||
" else if (JSVAL_IS_OBJECT(*vp)) {\n"
|
||||
" JSObject *jsobj = JSVAL_TO_OBJECT(*vp); \n"
|
||||
" nsISupports *supports = (nsISupports *)JS_GetPrivate(cx, jsobj);\n"
|
||||
" if (NS_OK != supports->QueryInterface(kI%sIID, (void **)&prop)) {\n"
|
||||
" return JS_FALSE;\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" else if (JSVAL_IS_NULL(*vp)) {\n"
|
||||
" prop = nsnull;\n"
|
||||
" }\n"
|
||||
" else {\n"
|
||||
" return JS_FALSE;\n"
|
||||
" }\n";
|
||||
|
Loading…
Reference in New Issue
Block a user