Bug 1525450 - Guard against a null controller. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D19057

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2019-02-08 16:43:50 +00:00
Родитель 1f90601aba
Коммит 8286a8c6ba
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -814,17 +814,16 @@ void APZCTreeManager::NotifyScrollbarDragInitiated(
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);
}