Bug 1315651: Check for null layer manager - we could be asking about the layer backend without it being there. r=gw280
authorMilan Sreckovic <milan@mozilla.com>
Mon, 07 Nov 2016 13:06:01 -0500
changeset 351507 1d01138a95d9607d534808bc47eba1bc70f0f9fb
parent 351506 2a77ca1fae251af0e4600c43c07912fcdb6dc071
child 351508 0440791609bd3a6f4b525f8ab754518573de1a3f
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)
reviewersgw280
bugs1315651
milestone52.0a1
Bug 1315651: Check for null layer manager - we could be asking about the layer backend without it being there. r=gw280 MozReview-Commit-ID: HMOfX1oFpf7
dom/html/HTMLCanvasElement.cpp
--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.cpp
@@ -1299,17 +1299,19 @@ HTMLCanvasElement::GetAsyncCanvasRendere
 }
 
 layers::LayersBackend
 HTMLCanvasElement::GetCompositorBackendType() const
 {
   nsIWidget* docWidget = nsContentUtils::WidgetForDocument(OwnerDoc());
   if (docWidget) {
     layers::LayerManager* layerManager = docWidget->GetLayerManager();
-    return layerManager->GetCompositorBackendType();
+    if (layerManager) {
+      return layerManager->GetCompositorBackendType();
+    }
   }
 
   return LayersBackend::LAYERS_NONE;
 }
 
 void
 HTMLCanvasElement::OnVisibilityChange()
 {