Skip to content
Snippets Groups Projects
Commit 6c5cb01c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix return return value when methods auto-open a message base (e.g. save_msg())

js_open() sets the rval for the context (e.g. to JSVAL_TRUE), so we need to set
it back to JSVAL_FALSE for failure conditions. Otherwise, the methods always
return true even upon (save-msg) failure.
parent d1f4767a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3388 passed
......@@ -2578,6 +2578,7 @@ js_save_msg(JSContext *cx, uintN argc, jsval *arglist)
return JS_FALSE;
if(JS_RVAL(cx, arglist) == JSVAL_FALSE)
return JS_TRUE;
JS_SET_RVAL(cx, arglist, JSVAL_FALSE);
}
memset(&msg,0,sizeof(msg));
......@@ -2727,6 +2728,7 @@ js_vote_msg(JSContext *cx, uintN argc, jsval *arglist)
return JS_FALSE;
if(JS_RVAL(cx, arglist) == JSVAL_FALSE)
return JS_TRUE;
JS_SET_RVAL(cx, arglist, JSVAL_FALSE);
}
memset(&msg, 0, sizeof(msg));
......@@ -2794,6 +2796,7 @@ js_add_poll(JSContext *cx, uintN argc, jsval *arglist)
return JS_FALSE;
if(JS_RVAL(cx, arglist) == JSVAL_FALSE)
return JS_TRUE;
JS_SET_RVAL(cx, arglist, JSVAL_FALSE);
}
memset(&msg, 0, sizeof(msg));
......
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