Skip to content
Snippets Groups Projects
Commit 78bb0597 authored by rswindell's avatar rswindell
Browse files

"null" is an object (according to JSVAL_IS_OBJECT) but can't be converted

to an object with JSVAL_TO_OBJECT(). Go figure.
parent 174c2a3c
No related branches found
No related tags found
No related merge requests found
......@@ -2650,7 +2650,7 @@ js_email(JSContext *cx, uintN argc, jsval *arglist)
js_top=JS_ValueToString(cx,argv[i]);
else if(JSVAL_IS_STRING(argv[i]))
js_subj=JS_ValueToString(cx,argv[i]);
else if(JSVAL_IS_OBJECT(argv[i])) {
else if(JSVAL_IS_OBJECT(argv[i]) && !JSVAL_IS_NULL(argv[i])) {
if((hdrobj = JSVAL_TO_OBJECT(argv[i])) == NULL)
return JS_FALSE;
if(!js_GetMsgHeaderObjectPrivates(cx, hdrobj, &resmb, &remsg, /* post: */NULL)) {
......@@ -2723,7 +2723,7 @@ js_netmail(JSContext *cx, uintN argc, jsval *arglist)
JSSTRING_TO_MSTRING(cx, js_str, subj, NULL);
}
}
else if(JSVAL_IS_OBJECT(argv[i])) {
else if(JSVAL_IS_OBJECT(argv[i]) && !JSVAL_IS_NULL(argv[i])) {
if((hdrobj = JSVAL_TO_OBJECT(argv[i])) == NULL)
return JS_FALSE;
if(!js_GetMsgHeaderObjectPrivates(cx, hdrobj, &resmb, &remsg, /* post: */NULL)) {
......@@ -3553,7 +3553,7 @@ js_post_msg(JSContext *cx, uintN argc, jsval *arglist)
if(!JS_ValueToECMAUint32(cx,argv[n],&mode))
return JS_FALSE;
}
else if(JSVAL_IS_OBJECT(argv[n])) {
else if(JSVAL_IS_OBJECT(argv[n]) && !JSVAL_IS_NULL(argv[n])) {
if((hdrobj=JSVAL_TO_OBJECT(argv[n]))==NULL)
return JS_FALSE;
if(!js_GetMsgHeaderObjectPrivates(cx, hdrobj, &resmb, &remsg, /* post: */NULL)) {
......@@ -3597,7 +3597,7 @@ js_show_msg(JSContext *cx, uintN argc, jsval *arglist)
if(!JS_ValueToECMAUint32(cx, argv[n], &p_mode))
return JS_FALSE;
}
else if(JSVAL_IS_OBJECT(argv[n])) {
else if(JSVAL_IS_OBJECT(argv[n]) && !JSVAL_IS_NULL(argv[n])) {
if((hdrobj=JSVAL_TO_OBJECT(argv[n]))==NULL)
return JS_FALSE;
if(!js_GetMsgHeaderObjectPrivates(cx, hdrobj, &smb, &msg, &post)) {
......@@ -3636,9 +3636,11 @@ js_show_msg_header(JSContext *cx, uintN argc, jsval *arglist)
JS_SET_RVAL(cx, arglist, JSVAL_VOID);
for(n=0; n<argc; n++) {
if(JSVAL_IS_OBJECT(argv[n])) {
if((hdrobj=JSVAL_TO_OBJECT(argv[n]))==NULL)
if(JSVAL_IS_OBJECT(argv[n]) && !JSVAL_IS_NULL(argv[n])) {
if((hdrobj=JSVAL_TO_OBJECT(argv[n]))==NULL) {
JS_ReportError(cx, "invalid object argument");
return JS_FALSE;
}
if(!js_GetMsgHeaderObjectPrivates(cx, hdrobj, &smb, &msg, NULL)) {
JS_ReportError(cx, "msg hdr object lacks privates");
return JS_FALSE;
......@@ -3685,7 +3687,7 @@ js_download_msg_attachments(JSContext *cx, uintN argc, jsval *arglist)
JS_SET_RVAL(cx, arglist, JSVAL_VOID);
for(n=0; n<argc; n++) {
if(JSVAL_IS_OBJECT(argv[n])) {
if(JSVAL_IS_OBJECT(argv[n]) && !JSVAL_IS_NULL(argv[n])) {
if((hdrobj=JSVAL_TO_OBJECT(argv[n]))==NULL)
return JS_FALSE;
if(!js_GetMsgHeaderObjectPrivates(cx, hdrobj, &smb, &msg, NULL)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment