From 2a645dbc6c98232cfbe080cb9a081e1ad585afa6 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 10 Nov 2006 16:04:22 +0000 Subject: [PATCH] fix segfault when no filename is available to log. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3305 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 24dcc39464..3c012fb73f 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -451,7 +451,7 @@ JSClass event_class = { static void js_error(JSContext *cx, const char *message, JSErrorReport *report) { if (message) { - switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *)report->filename, modname, report->lineno, SWITCH_LOG_ERROR, + switch_log_printf(SWITCH_CHANNEL_ID_LOG, report->filename ? (char *)report->filename : "mod_spidermonkey.c", modname, report->lineno, SWITCH_LOG_ERROR, "%s %s%s\n", message, report->linebuf ? "near " : "", report->linebuf ? report->linebuf : ""); }