Bug 1325159 - Add nullptr check for GetTop(). r=mattwoodrow
authorEthan Lin <ethlin@mozilla.com>
Thu, 22 Dec 2016 01:11:00 +0100
changeset 328727 47dd6b1e1dbd7d4f2816c9d6f1acce6130f0292d
parent 328726 a5d77680287366f710d086d93476b9075aa5df9b
child 328728 59ff490ac047771723e48e4cab72dd8724a7b442
push id85517
push usercbook@mozilla.com
push dateTue, 10 Jan 2017 14:33:57 +0000
treeherdermozilla-inbound@2a368ffc91eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1325159
milestone53.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 1325159 - Add nullptr check for GetTop(). r=mattwoodrow
layout/painting/nsDisplayList.h
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -4445,16 +4445,19 @@ public:
   }
 
   virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
                                    LayerManager* aManager,
                                    const ContainerLayerParameters& aParameters) override;
 
   virtual bool ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder) override
   {
+    if (!mList.GetChildren()->GetTop()) {
+      return false;
+    }
     return mList.GetChildren()->GetTop()->ShouldBuildLayerEvenIfInvisible(aBuilder);
   }
 
   virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                              LayerManager* aManager,
                                              const ContainerLayerParameters& aContainerParameters) override;
 
   virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
@@ -4471,17 +4474,19 @@ public:
   }
 
   nsIFrame* TransformFrame() { return mTransformFrame; }
 
   virtual int32_t ZIndex() const override;
 
   virtual void
   DoUpdateBoundsPreserves3D(nsDisplayListBuilder* aBuilder) override {
-    static_cast<nsDisplayTransform*>(mList.GetChildren()->GetTop())->DoUpdateBoundsPreserves3D(aBuilder);
+    if (mList.GetChildren()->GetTop()) {
+      static_cast<nsDisplayTransform*>(mList.GetChildren()->GetTop())->DoUpdateBoundsPreserves3D(aBuilder);
+    }
   }
 
 private:
   nsDisplayWrapList mList;
   nsIFrame* mTransformFrame;
   uint32_t mIndex;
 };