diff options
author | portix <none@none> | 2012-11-03 03:27:23 +0100 |
---|---|---|
committer | portix <none@none> | 2012-11-03 03:27:23 +0100 |
commit | aca4f87e0892e1b5b8bdc3a2d49118b9b1c36484 (patch) | |
tree | ad71e7ab79686180465dbfd135858ae3ab1ed525 /src | |
parent | 6ae8d205fa646b0b860bd23b7b23762f970b2435 (diff) | |
download | dwb-aca4f87e0892e1b5b8bdc3a2d49118b9b1c36484.zip |
Fixing possible segfault in scripts_emit
Diffstat (limited to 'src')
-rw-r--r-- | src/scripts.c | 5 |
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; |