diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 75d3c1861a..3ef2f6cd8c 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -3545,7 +3545,9 @@ nsGlobalWindow::GetEventTargetParent(EventChainPreVisitor& aVisitor) aVisitor.mCanHandle = true; // Middle/right click shouldn't dispatch click event, use auxclick to instead. - if (mDoc->IsXULDocument()) { + // Note: mDoc should always exist here, but check just in case someone yanked + // it out from under us. + if (mDoc && mDoc->IsXULDocument()) { aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119 } if (msg == eResize && aVisitor.mEvent->IsTrusted()) {