fix up some event issues

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5541 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2007-07-24 21:26:04 +00:00
1 parent 46e564502a
commit 25057d40ac
3 files changed
+31 -15

No files matched your search

@@ -354,12 +354,12 @@ static JSBool event_construct(JSContext * cx, JSObject * obj, uintN argc, jsval
if (etype == SWITCH_EVENT_CUSTOM) {
char *subclass_name;
if (argc < 1) {
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;
if (argc > 1) {
subclass_name = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
} else {
subclass_name = "none";
}
subclass_name = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
if (switch_event_create_subclass(&event, etype, subclass_name) != SWITCH_STATUS_SUCCESS) {
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
return JS_TRUE;