diff --git a/src/switch_event.c b/src/switch_event.c index 01ad05c681..a8e97ca636 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -441,9 +441,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, cha char data[2048]; va_list ap; - va_start(ap, fmt); - vsnprintf(data, sizeof(data), fmt, ap); - va_end(ap); + if (fmt) { + va_start(ap, fmt); + vsnprintf(data, sizeof(data), fmt, ap); + va_end(ap); + } if (ret == -1) { return SWITCH_STATUS_MEMERR;