From 5abcb22486a9524ea2ca1d8ad02e2758b7d9402c Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 4 Apr 2008 21:36:04 +0000 Subject: [PATCH] build tweaks git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8027 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core_session.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 5cbaa42853..48fa580128 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -980,15 +980,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application(switch_c } } - if ((expanded = switch_channel_expand_variables(session->channel, arg)) != arg) { + if (arg && (expanded = switch_channel_expand_variables(session->channel, arg)) != arg) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Expanded String %s(%s)\n", switch_channel_get_name(session->channel), app, expanded); } if (switch_channel_get_variable(session->channel, "presence_id")) { - char *arg = switch_mprintf("%s(%s)", app, expanded); - if (arg) { - switch_channel_presence(session->channel, "unknown", arg); - switch_safe_free(arg); + char *myarg = NULL; + if (expanded) { + switch_mprintf("%s(%s)", app, expanded); + } + if (myarg) { + switch_channel_presence(session->channel, "unknown", myarg); + switch_safe_free(myarg); } }