Index: Source/core/input/EventHandler.cpp |
diff --git a/Source/core/input/EventHandler.cpp b/Source/core/input/EventHandler.cpp |
index 006aa2c40a9b7a45bfea777b122a31c3acd2a0e9..e869308b11cf8dc9dd93b3a1a5d3f02d57519328 100644 |
--- a/Source/core/input/EventHandler.cpp |
+++ b/Source/core/input/EventHandler.cpp |
@@ -2126,6 +2126,7 @@ bool EventHandler::handleGestureLongPress(const GestureEventWithHitTestResults& |
IntPoint hitTestPoint = m_frame->view()->rootFrameToContents(gestureEvent.position()); |
HitTestResult result = hitTestResultAtPoint(hitTestPoint); |
+ RefPtrWillBeRawPtr<FrameView> protector(m_frame->view()); |
if (selectionController().handleGestureLongPress(gestureEvent, result)) { |
focusDocumentView(); |
return true; |
@@ -2785,7 +2786,7 @@ bool EventHandler::sendContextMenuEventForKey(Element* overrideTargetElement) |
// The contextmenu event is a mouse event even when invoked using the keyboard. |
// This is required for web compatibility. |
PlatformEvent::Type eventType = PlatformEvent::MousePressed; |
- if (m_frame->settings()->showContextMenuOnMouseUp()) |
+ if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp()) |
eventType = PlatformEvent::MouseReleased; |
PlatformMouseEvent mouseEvent(locationInRootFrame, globalPosition, RightButton, eventType, 1, false, false, false, false, PlatformMouseEvent::RealOrIndistinguishable, WTF::currentTime()); |
@@ -2808,7 +2809,7 @@ bool EventHandler::sendContextMenuEventForGesture(const GestureEventWithHitTestR |
PlatformEvent::Type eventType = PlatformEvent::MousePressed; |
- if (m_frame->settings()->showContextMenuOnMouseUp()) |
+ if (m_frame->settings() && m_frame->settings()->showContextMenuOnMouseUp()) |
eventType = PlatformEvent::MouseReleased; |
else |
modifiers |= PlatformEvent::RightButtonDown; |