diff options
Diffstat (limited to 'src/scripts.c')
-rw-r--r-- | src/scripts.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scripts.c b/src/scripts.c index 71c1d4ce..38e31368 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -638,8 +638,6 @@ global_bind(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size return JSValueMakeBoolean(ctx, false); } gchar *keystr = js_value_to_char(ctx, argv[0], JS_STRING_MAX, exc); - if (keystr == NULL) - goto error_out; JSObjectRef func = JSValueToObject(ctx, argv[1], exc); if (func == NULL) goto error_out; @@ -656,6 +654,8 @@ global_bind(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size g_free(callback_name); } } + if (keystr == NULL && name == NULL) + goto error_out; JSValueProtect(ctx, func); KeyMap *map = dwb_malloc(sizeof(KeyMap)); FunctionMap *fmap = dwb_malloc(sizeof(FunctionMap)); |