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 348155 1d01138a95d9607d534808bc47eba1bc70f0f9fb
parent 348154 2a77ca1fae251af0e4600c43c07912fcdb6dc071
child 348156 0440791609bd3a6f4b525f8ab754518573de1a3f
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [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()
 {