fix seg in js

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10851 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-12-17 15:35:40 +00:00
parent 26df7a3921
commit dbf10cab75
1 changed files with 3 additions and 4 deletions

View File

@ -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);