1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

SMJS: Better handle when the C code tries to call a badly defined method

Before, when one assigned a value other than a function to
elinks.preformat_html, elinks.goto_url_hook, or elinks.follow_url_hook,
an assertion failure was triggered (and probably worse happened in
non-DEBUG builds). Now just fail silently.
This commit is contained in:
Miciah Dashiel Butler Masters 2006-06-10 18:09:31 +00:00 committed by Miciah Dashiel Butler Masters
parent 355cbebaad
commit ec1ab9fbe9

View File

@ -180,7 +180,7 @@ smjs_invoke_elinks_object_method(unsigned char *method, jsval argv[], int argc,
return JS_FALSE;
func = JS_ValueToFunction(smjs_ctx, *rval);
assert(func);
if (!func) return JS_FALSE;
return JS_CallFunction(smjs_ctx, smjs_elinks_object,
func, argc, argv, rval);