Bug 1335794 - Fix JavaScript Error (TypeError: mm is null) by adding a null checking. r=florian
authorMunro Mengjue Chiang <mchiang@mozilla.com>
Thu, 02 Feb 2017 11:39:08 +0800
changeset 358893 f4a0fbbefd444b54ab3d2daae5cb297fa7988acd
parent 358892 f78fc2f94d078089b75b6a055a5ae72205386e6a
child 358894 9406c3c13338279f95833ca0da17656f81b183bf
push id10672
push userryanvm@gmail.com
push dateThu, 02 Feb 2017 23:56:06 +0000
treeherdermozilla-aurora@c422e37f1667 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1335794
milestone53.0a2
Bug 1335794 - Fix JavaScript Error (TypeError: mm is null) by adding a null checking. r=florian MozReview-Commit-ID: 9CdsvEU4AOa
browser/modules/ContentWebRTC.jsm
--- a/browser/modules/ContentWebRTC.jsm
+++ b/browser/modules/ContentWebRTC.jsm
@@ -131,17 +131,18 @@ function handleGUMStop(aSubject, aTopic,
 
   let request = {
     windowID: aSubject.windowID,
     rawID: aSubject.rawID,
     mediaSource: aSubject.mediaSource,
   };
 
   let mm = getMessageManagerForWindow(contentWindow);
-  mm.sendAsyncMessage("webrtc:StopRecording", request);
+  if (mm)
+    mm.sendAsyncMessage("webrtc:StopRecording", request);
 }
 
 function handleGUMRequest(aSubject, aTopic, aData) {
   let constraints = aSubject.getConstraints();
   let secure = aSubject.isSecure;
   let contentWindow = Services.wm.getOuterWindowWithId(aSubject.windowID);
 
   contentWindow.navigator.mozGetUserMediaDevices(