From 727deeeee055a9e205859afb14d6c75505a1869a Mon Sep 17 00:00:00 2001 From: portix Date: Sat, 1 Sep 2012 12:08:30 +0200 Subject: Cleaning dwbem.c; bind keys in global_bind if either shortcut or command is not null --- src/scripts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/scripts.c') 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)); -- cgit v1.2.3