summaryrefslogtreecommitdiff
path: root/src/scripts.c
diff options
context:
space:
mode:
authorportix <none@none>2012-09-01 12:08:30 +0200
committerportix <none@none>2012-09-01 12:08:30 +0200
commit727deeeee055a9e205859afb14d6c75505a1869a (patch)
tree8bcf79f0f78183d81afebc3630b2b0cb0fe09267 /src/scripts.c
parent737b2337eb411a7a71e46e450bcad708f8d52dfe (diff)
downloaddwb-727deeeee055a9e205859afb14d6c75505a1869a.zip
Cleaning dwbem.c; bind keys in global_bind if either shortcut or command is not null
Diffstat (limited to 'src/scripts.c')
-rw-r--r--src/scripts.c4
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));