If the website provides its own context menu then we don't have a ContextMenu pointer.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29527
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
WebCore::Frame* focusedFrame = page->focusController()->focusedOrMainFrame();
focusedFrame->eventHandler()->sendContextMenuEvent(PlatformMouseEvent(ev, 1));
ContextMenu *menu = page->contextMenuController()->contextMenu();
+ // If the website defines its own handler then sendContextMenuEvent takes care of
+ // calling/showing it and the context menu pointer will be zero. This is the case
+ // on maps.google.com for example.
+ if (!menu)
+ return;
QWebPageContext oldContext = currentContext;
currentContext = QWebPageContext(menu->hitTestResult());
+2008-01-16 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger.
+
+ Fix crash when bringing up the context menu on maps.google.com.
+
+ If the website provides its own context menu then we don't have a ContextMenu pointer.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::contextMenuEvent):
+
2008-01-16 Simon Hausmann <hausmann@webkit.org>
Reviewed by Holger.