From 4da5a5f601f7061658ae3cbb8ae689811d112ce9 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 3 Aug 2007 04:06:58 +0000 Subject: [PATCH] fix for MODLANG-37 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5553 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_spidermonkey/mod_spidermonkey.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index dbb5bee0ec..4ddce92c27 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -1527,15 +1527,15 @@ static JSBool session_speak(JSContext * cx, JSObject * obj, uintN argc, jsval * CHANNEL_SANITY_CHECK(); - if (argc > 0) { - tts_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0])); - } - if (argc > 1) { - voice_name = JS_GetStringBytes(JS_ValueToString(cx, argv[1])); - } - if (argc > 2) { - text = JS_GetStringBytes(JS_ValueToString(cx, argv[2])); - } + if (argc < 3) { + *rval = BOOLEAN_TO_JSVAL(JS_FALSE); + return JS_FALSE; + } + + tts_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0])); + voice_name = JS_GetStringBytes(JS_ValueToString(cx, argv[1])); + text = JS_GetStringBytes(JS_ValueToString(cx, argv[2])); + if (argc > 3) { if ((function = JS_ValueToFunction(cx, argv[3]))) { memset(&cb_state, 0, sizeof(cb_state));