Bug 1148641 - Guard against null parameters to SendSetTargetAPZCNotification. r=botond, a=bajaj
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 02 Apr 2015 06:57:45 -0400
changeset 238134 98e34ab531a2439bb7c14edec8e76b9d4b77030d
parent 238133 7e7accd7a911b67c54987ff8a7749bd5e1c406cf
child 238135 c09519f7f74c2227e0194a7c58e7c5d8f0bf53f8
push id488
push userryanvm@gmail.com
push dateMon, 13 Apr 2015 20:29:57 +0000
treeherdermozilla-b2g37_v2_2@85ea1be9ac7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond, bajaj
bugs1148641
milestone37.0
Bug 1148641 - Guard against null parameters to SendSetTargetAPZCNotification. r=botond, a=bajaj
gfx/layers/apz/util/APZCCallbackHelper.cpp
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -597,16 +597,19 @@ SendSetTargetAPZCNotificationHelper(nsIP
 void
 APZCCallbackHelper::SendSetTargetAPZCNotification(nsIWidget* aWidget,
                                                   nsIDocument* aDocument,
                                                   const WidgetGUIEvent& aEvent,
                                                   const ScrollableLayerGuid& aGuid,
                                                   uint64_t aInputBlockId,
                                                   const nsRefPtr<SetTargetAPZCCallback>& aCallback)
 {
+  if (!aWidget || !aDocument) {
+    return;
+  }
   if (nsIPresShell* shell = aDocument->GetShell()) {
     if (nsIFrame* rootFrame = shell->GetRootFrame()) {
       bool waitForRefresh = false;
       nsTArray<ScrollableLayerGuid> targets;
 
       if (const WidgetTouchEvent* touchEvent = aEvent.AsTouchEvent()) {
         for (size_t i = 0; i < touchEvent->touches.Length(); i++) {
           waitForRefresh |= PrepareForSetTargetAPZCNotification(aWidget, aGuid,