Adds a nullptr check to prevent a rare crash when starting or stopping an RtcEventLog.

BUG=webrtc:4741,chromium:581788

Review URL: https://codereview.webrtc.org/1666843003

Cr-Commit-Position: refs/heads/master@{#11490}
This commit is contained in:
ivoc 2016-02-04 06:33:37 -08:00 committed by Commit bot
parent 15ba6242ad
commit 20834ca806

View File

@ -1153,12 +1153,22 @@ void WebRtcVoiceEngine::StopAecDump() {
bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
return voe_wrapper_->codec()->GetEventLog()->StartLogging(file);
webrtc::RtcEventLog* event_log = voe_wrapper_->codec()->GetEventLog();
if (event_log) {
return event_log->StartLogging(file);
}
LOG_RTCERR0(StartRtcEventLog);
return false;
}
void WebRtcVoiceEngine::StopRtcEventLog() {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
voe_wrapper_->codec()->GetEventLog()->StopLogging();
webrtc::RtcEventLog* event_log = voe_wrapper_->codec()->GetEventLog();
if (event_log) {
event_log->StopLogging();
return;
}
LOG_RTCERR0(StopRtcEventLog);
}
int WebRtcVoiceEngine::CreateVoEChannel() {