Bug 1461118 - Null-check mGeckoChild after calling DispatchInputEvent. r=spohl
authorMarkus Stange <mstange@themasta.com>
Mon, 28 May 2018 18:00:35 -0400
changeset 474382 f620bf59c952171ad45d9b4ccca3fe7231ebf818
parent 474381 d29d89978c45cb879cba002eb8b4d80cd62bd92f
child 474383 d6fd83af52c313c06791a7d83a2a88d1fb9c1e72
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl
bugs1461118
milestone62.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 1461118 - Null-check mGeckoChild after calling DispatchInputEvent. r=spohl MozReview-Commit-ID: 4bfe8TM4GuS
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -4638,16 +4638,20 @@ NSEvent* gLastDragMouseDownEvent = nil;
   // Remember the event's position before calling DispatchInputEvent, because
   // that call can mutate it and convert it into a different coordinate space.
   LayoutDeviceIntPoint pos = geckoEvent.mRefPoint;
 
   // This might destroy our widget (and null out mGeckoChild).
   bool defaultPrevented =
     (mGeckoChild->DispatchInputEvent(&geckoEvent) == nsEventStatus_eConsumeNoDefault);
 
+  if (!mGeckoChild) {
+    return;
+  }
+
   // Check to see if we are double-clicking in draggable parts of the window.
   if (!defaultPrevented && [theEvent clickCount] == 2 &&
       !mGeckoChild->GetNonDraggableRegion().Contains(pos.x, pos.y)) {
     if ([self shouldZoomOnDoubleClick]) {
       [[self window] performZoom:nil];
     } else if ([self shouldMinimizeOnTitlebarDoubleClick]) {
       NSButton *minimizeButton = [[self window] standardWindowButton:NSWindowMiniaturizeButton];
       [minimizeButton performClick:self];