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
This commit is contained in:
parent
2450b0e624
commit
2a645dbc6c
|
@ -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 : "");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue