be more careful about not dereferencing NULL (attempt to fix MODAPP-45)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6085 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-10-29 18:18:13 +00:00
parent ae790526e4
commit fa7d8da54c
1 changed files with 12 additions and 4 deletions

View File

@ -350,11 +350,19 @@ static switch_status_t conference_add_event_data(conference_obj_t * conference,
static switch_status_t conference_add_event_member_data(conference_member_t * member, switch_event_t *event)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_channel_t *channel = switch_core_session_get_channel(member->session);
switch_channel_event_set_data(channel, event);
if (member) {
if (member->session) {
switch_channel_t *channel = switch_core_session_get_channel(member->session);
switch_channel_event_set_data(channel, event);
}
status = conference_add_event_data(member->conference, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
if (member->conference) {
status = conference_add_event_data(member->conference, event);
}
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
}
return status;
}