Bug 1531130 - Add some missing null checks. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 11 Mar 2019 14:18:58 +0000
changeset 521375 51fc0fd585a7
parent 521374 54607c048929
child 521376 c97ec09c6d15
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1531130
milestone67.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 1531130 - Add some missing null checks. r=botond Differential Revision: https://phabricator.services.mozilla.com/D22955
gfx/layers/apz/util/APZCCallbackHelper.cpp
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -864,16 +864,19 @@ APZCCallbackHelper::SendSetTargetAPZCNot
   }
   return nullptr;
 }
 
 void APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
     nsIWidget* aWidget, dom::Document* aDocument,
     const WidgetTouchEvent& aEvent, uint64_t aInputBlockId,
     const SetAllowedTouchBehaviorCallback& aCallback) {
+  if (!aWidget || !aDocument) {
+    return;
+  }
   if (nsIPresShell* shell = aDocument->GetShell()) {
     if (nsIFrame* rootFrame = shell->GetRootFrame()) {
       rootFrame = UpdateRootFrameForTouchTargetDocument(rootFrame);
 
       nsTArray<TouchBehaviorFlags> flags;
       for (uint32_t i = 0; i < aEvent.mTouches.Length(); i++) {
         flags.AppendElement(TouchActionHelper::GetAllowedTouchBehavior(
             aWidget, rootFrame, aEvent.mTouches[i]->mRefPoint));