Bug 1525450 - Guard against a null controller. r=botond a=lizzard
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 08 Feb 2019 16:43:50 +0000
changeset 513011 ce8af16e73564df817ad02ccbd65741e2c232490
parent 513010 c2302c9395b1f60d1cb5b105fffe5d3a3173e8a4
child 513012 c621e6736f7934b85e8d651adaefc7ed37fa3e63
push id10681
push userdluca@mozilla.com
push dateTue, 12 Feb 2019 11:10:25 +0000
treeherdermozilla-beta@8b1e6095f355 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond, lizzard
bugs1525450
milestone66.0
Bug 1525450 - Guard against a null controller. r=botond a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D19057
gfx/layers/apz/src/APZCTreeManager.cpp
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -803,27 +803,26 @@ void APZCTreeManager::StopAutoscroll(con
   }
 }
 
 void APZCTreeManager::NotifyScrollbarDragInitiated(
     uint64_t aDragBlockId, const ScrollableLayerGuid& aGuid,
     ScrollDirection aDirection) const {
   RefPtr<GeckoContentController> controller =
       GetContentController(aGuid.mLayersId);
-  MOZ_ASSERT(controller);
-  controller->NotifyAsyncScrollbarDragInitiated(aDragBlockId, aGuid.mScrollId,
-                                                aDirection);
+  if (controller) {
+    controller->NotifyAsyncScrollbarDragInitiated(aDragBlockId, aGuid.mScrollId,
+                                                  aDirection);
+  }
 }
 
 void APZCTreeManager::NotifyScrollbarDragRejected(
     const ScrollableLayerGuid& aGuid) const {
   RefPtr<GeckoContentController> controller =
       GetContentController(aGuid.mLayersId);
-  // If you hit this crash and have STR, please file a bug!
-  MOZ_ASSERT(controller);
   if (controller) {
     controller->NotifyAsyncScrollbarDragRejected(aGuid.mScrollId);
   }
 }
 
 void APZCTreeManager::NotifyAutoscrollRejected(
     const ScrollableLayerGuid& aGuid) const {
   RefPtr<GeckoContentController> controller =