bug 1516426, null check touch target before trying to access it's frame, r=masayuki
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Mon, 07 Jan 2019 15:05:11 +0200
changeset 509811 7814dee9683a53a14259a3ca30d1639b14eb87c6
parent 509810 e2ce50212f4939a10144b27e0fba3c10bc8fc4c7
child 509812 3b6cfb4b1e57165bc787d76123b036df299d368e
child 509836 2ff3ca75744a911868b7a8b3f440682cb8e96fc5
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1516426
milestone66.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 1516426, null check touch target before trying to access it's frame, r=masayuki
layout/base/TouchManager.cpp
--- a/layout/base/TouchManager.cpp
+++ b/layout/base/TouchManager.cpp
@@ -170,17 +170,18 @@ void TouchManager::EvictTouches() {
     --i;
     dom::Touch* touch = aEvent->mTouches[i];
     if (TouchManager::HasCapturedTouch(touch->Identifier())) {
       continue;
     }
 
     MOZ_ASSERT(touch->mOriginalTarget);
     nsCOMPtr<nsIContent> targetContent = do_QueryInterface(touch->GetTarget());
-    nsIFrame* targetFrame = targetContent->GetPrimaryFrame();
+    nsIFrame* targetFrame =
+        targetContent ? targetContent->GetPrimaryFrame() : nullptr;
     if (targetFrame && !anyTarget) {
       anyTarget = targetContent;
     } else {
       nsIFrame* newTargetFrame = nullptr;
       for (nsIFrame* f = targetFrame; f;
            f = nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(f)) {
         if (f->PresContext()->Document() == anyTarget->OwnerDoc()) {
           newTargetFrame = f;