Bug 1516426 - Null check touch target before trying to access it's frame. r=masayuki, a=RyanVM DEVEDITION_65_0b9_BUILD1 DEVEDITION_65_0b9_RELEASE FENNEC_65_0b9_BUILD1 FIREFOX_65_0b9_BUILD1 FIREFOX_65_0b9_RELEASE
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Mon, 07 Jan 2019 15:05:11 +0200
changeset 506562 df848230cb305771d7cdf12d6a0f180d751e51cb
parent 506561 c7cda6be6a94cf4221c32785e6b844a9cd4ffd35
child 506563 6a245743a10edfff1ad015fa7fbd670b5a541e31
push id10460
push userryanvm@gmail.com
push dateMon, 07 Jan 2019 18:02:00 +0000
treeherdermozilla-beta@df848230cb30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki, RyanVM
bugs1516426
milestone65.0
Bug 1516426 - Null check touch target before trying to access it's frame. r=masayuki, a=RyanVM
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;