summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2012-11-03 03:27:23 +0100
committerportix <none@none>2012-11-03 03:27:23 +0100
commitaca4f87e0892e1b5b8bdc3a2d49118b9b1c36484 (patch)
treead71e7ab79686180465dbfd135858ae3ab1ed525 /src
parent6ae8d205fa646b0b860bd23b7b23762f970b2435 (diff)
downloaddwb-aca4f87e0892e1b5b8bdc3a2d49118b9b1c36484.zip
Fixing possible segfault in scripts_emit
Diffstat (limited to 'src')
-rw-r--r--src/scripts.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/scripts.c b/src/scripts.c
index dd0ae0db..120b1f9c 100644
--- a/src/scripts.c
+++ b/src/scripts.c
@@ -1557,7 +1557,10 @@ scripts_emit(ScriptSignal *sig) {
val[i++] = sig->jsobj;
}
for (int j=0; j<sig->numobj; j++) {
- val[i++] = make_object(m_global_context, G_OBJECT(sig->objects[j]));
+ if (sig->objects[j] != NULL)
+ val[i++] = make_object(m_global_context, G_OBJECT(sig->objects[j]));
+ else
+ val[i++] = JSValueMakeNull(m_global_context);
}
JSValueRef vson = js_json_to_value(m_global_context, sig->json);
val[i++] = vson == NULL ? JSValueMakeNull(m_global_context) : vson;