Bug 1300016 - only suspend web-speech when mUtterance exists. r=eeejay
authorAlastor Wu <alwu@mozilla.com>
Mon, 07 Nov 2016 17:49:13 +0800
changeset 352057 117b0fa754f7879063174e138cfdf05d1c8dfabb
parent 352056 1fdb1f8a9ddd74fde0ce54694fb096e5317adce7
child 352058 9cfc41a2869ee9a880aaae5d22a34e2daa7b64b6
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1300016
milestone52.0a1
Bug 1300016 - only suspend web-speech when mUtterance exists. r=eeejay MozReview-Commit-ID: E29qJ1sgZ5c
dom/media/webspeech/synth/nsSpeechTask.cpp
--- a/dom/media/webspeech/synth/nsSpeechTask.cpp
+++ b/dom/media/webspeech/synth/nsSpeechTask.cpp
@@ -742,16 +742,20 @@ nsSpeechTask::WindowVolumeChanged(float 
 {
   SetAudioOutputVolume(aMuted ? 0.0 : mVolume * aVolume);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSpeechTask::WindowSuspendChanged(nsSuspendedTypes aSuspend)
 {
+  if (!mUtterance) {
+    return NS_OK;
+  }
+
   if (aSuspend == nsISuspendedTypes::NONE_SUSPENDED &&
       mUtterance->mPaused) {
     Resume();
   } else if (aSuspend != nsISuspendedTypes::NONE_SUSPENDED &&
              !mUtterance->mPaused) {
     Pause();
   }
   return NS_OK;