diff options
author | portix <portix@gmx.net> | 2012-03-19 11:07:51 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-03-19 11:07:51 +0100 |
commit | 73e205c62de92259fd18cc0f36b294cd5b076f38 (patch) | |
tree | 6c858ba789412c5ddccc8c81e7403a29376dc228 /src/js.c | |
parent | e7471d91a0dbb48c0f33d83fa592203c8d124b14 (diff) | |
download | dwb-73e205c62de92259fd18cc0f36b294cd5b076f38.zip |
Call JSValueProtect only if JSValueToObject was successfull
Diffstat (limited to 'src/js.c')
-rw-r--r-- | src/js.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -94,10 +94,10 @@ js_create_object(WebKitWebFrame *frame, const char *script) { if (exc != NULL) return NULL; JSStringRelease(jsscript); - JSValueProtect(ctx, ret); JSObjectRef return_object = JSValueToObject(ctx, ret, &exc); if (exc != NULL) return NULL; + JSValueProtect(ctx, ret); JSPropertyNameArrayRef array = JSObjectCopyPropertyNames(ctx, return_object); for (int i=0; i<JSPropertyNameArrayGetCount(array); i++) { JSStringRef prop_name = JSPropertyNameArrayGetNameAtIndex(array, i); |