From dbf10cab75eae2d164c1cfd4d4de297e16c39db6 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 17 Dec 2008 15:35:40 +0000 Subject: [PATCH] fix seg in js git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10851 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 63c0a26f59..6bea8d86fd 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -1778,6 +1778,8 @@ static JSBool session_set_variable(JSContext * cx, JSObject * obj, uintN argc, j struct js_session *jss = JS_GetPrivate(cx, obj); switch_channel_t *channel; + METHOD_SANITY_CHECK(); + channel = switch_core_session_get_channel(jss->session); if (argc > 1) { @@ -1799,10 +1801,7 @@ static JSBool session_get_variable(JSContext * cx, JSObject * obj, uintN argc, j struct js_session *jss = JS_GetPrivate(cx, obj); switch_channel_t *channel; - if (!jss || !jss->session) { - *rval = BOOLEAN_TO_JSVAL(JS_FALSE); - return JS_TRUE; - } + METHOD_SANITY_CHECK(); channel = switch_core_session_get_channel(jss->session);