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 321568 1d01138a95d9607d534808bc47eba1bc70f0f9fb
parent 321567 2a77ca1fae251af0e4600c43c07912fcdb6dc071
child 321569 0440791609bd3a6f4b525f8ab754518573de1a3f
push id83647
push userkwierso@gmail.com
push dateTue, 08 Nov 2016 22:08:41 +0000
treeherdermozilla-inbound@1d0b02250149 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw280
bugs1315651
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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()
 {