Reviewed by Adele.
[WebKit-https.git] / WebCore / bridge / mac / FrameMac.mm
index 11de414933a4f5dd00e1e90eb5fa9d32e61160f2..dc5c4767358c46acf9cdb5e3c17548030695a6a5 100644 (file)
@@ -2141,7 +2141,8 @@ bool FrameMac::sendContextMenuEvent(NSEvent *event)
 
     swallowEvent = v->dispatchMouseEvent(contextmenuEvent, mev.targetNode(), true, 0, mouseEvent, true);
     if (!swallowEvent && !isPointInsideSelection(viewportPos) &&
-        ([_bridge selectWordBeforeMenuEvent] || [_bridge isEditable] || mev.targetNode()->isContentEditable())) {
+            ([_bridge selectWordBeforeMenuEvent] || [_bridge isEditable]
+                || (mev.targetNode() && mev.targetNode()->isContentEditable()))) {
         _mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection
         selectClosestWordFromMouseEvent(mouseEvent, mev.targetNode());
     }