diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index f720b6927275..a4a173f8b45d 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -1589,7 +1589,7 @@ EventStateManager::GenerateDragGesture(nsPresContext* aPresContext, if (IsTrackingDragGesture()) { mCurrentTarget = mGestureDownFrameOwner->GetPrimaryFrame(); - if (!mCurrentTarget) { + if (!mCurrentTarget || !mCurrentTarget->GetNearestWidget()) { StopTrackingDragGesture(); return; }