Bug 1359995: Add back the null-check on curData. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 27 Apr 2017 00:26:40 +0200
changeset 569058 eb08eb93743186cddc416f044691e055652de8ca
parent 569057 99492bc4e1053c945c4531513067284c030c2fca
child 626100 f0dec23ffce62ffc6a8e5af55d79877e398d5ed2
push id56058
push userbmo:emilio+bugs@crisal.io
push dateWed, 26 Apr 2017 22:29:45 +0000
reviewersheycam
bugs1359995
milestone55.0a1
Bug 1359995: Add back the null-check on curData. r?heycam I removed it, but seems it can be hit. It'd be nice to have a test-case where it fails though... MozReview-Commit-ID: 7Xa3dNHwFMn
layout/base/RestyleTracker.h
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -345,17 +345,19 @@ RestyleTracker::AddPendingRestyle(Elemen
       // the descendant.
       RestyleData* curData;
       mPendingRestyles.Get(cur, &curData);
 
       // Even if cur has a ForceDescendants restyle hint, we're not guaranteed
       // to reach aElement in the case the PresShell posts a restyle event from
       // PostRecreateFramesFor, so we need to track it here.
       MOZ_ASSERT(curData, "expected to find a RestyleData for cur");
-      curData->mDescendants.AppendElement(aElement);
+      if (curData) {
+        curData->mDescendants.AppendElement(aElement);
+      }
     }
   }
 
   mHaveLaterSiblingRestyles =
     mHaveLaterSiblingRestyles || (aRestyleHint & eRestyle_LaterSiblings) != 0;
   return hadRestyleLaterSiblings;
 }