diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-10-09 00:57:36 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-10-09 00:57:36 +0000 |
commit | f74e3d40fdf2ca82c73490dc5d0cb1dd7b4ec028 (patch) | |
tree | b6c48c771760b77ecb07e305e328769b2e92aef0 /indra/newview/llimview.cpp | |
parent | 81e0fb43caa27491fa18b17d6a05cafb0e20dfa6 (diff) |
Added safety checks wherever getSpeakerManager() is called.
Removed a meaningless (and misleading) const qualifier to a LLPointer return value.
Added a getter for LLSpeakerMgr::mVoiceChannel to replace some very incorrect code casting LLIMSpeakerMgr to LLVoiceChannelP2P
Reviewed by Leyla
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 7a7b062b5d..6b947b2503 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1432,12 +1432,15 @@ LLUUID LLIMMgr::addP2PSession(const std::string& name, { LLUUID session_id = addSession(name, IM_NOTHING_SPECIAL, other_participant_id); - LLVoiceChannelP2P* voice_channel = dynamic_cast<LLVoiceChannelP2P*>(LLIMModel::getInstance()->getSpeakerManager(session_id)); - if (voice_channel) + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id); + if (speaker_mgr) { - voice_channel->setSessionHandle(voice_session_handle, caller_uri); + LLVoiceChannelP2P* voice_channel = dynamic_cast<LLVoiceChannelP2P*>(speaker_mgr->getVoiceChannel()); + if (voice_channel) + { + voice_channel->setSessionHandle(voice_session_handle, caller_uri); + } } - return session_id; } |