]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
build tweaks
authorMichael Jerris <mike@jerris.com>
Fri, 4 Apr 2008 21:36:04 +0000 (21:36 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 4 Apr 2008 21:36:04 +0000 (21:36 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8027 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core_session.c

index 5cbaa4285304332881a0e745ed186fe57141a6cb..48fa580128499f90bb241259cad17f3eaa356794 100644 (file)
@@ -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);
                }
        }