When we are creating a ContextMenuItem, only call setSubMenu if we have
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Dec 2010 23:41:04 +0000 (23:41 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Dec 2010 23:41:04 +0000 (23:41 +0000)
a subMenu to set.

Reviewed by Ada Chan.

* platform/ContextMenuItem.cpp:
(WebCore::ContextMenuItem::ContextMenuItem):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73813 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/ContextMenuItem.cpp

index ec0aa9f..315f2bf 100644 (file)
@@ -1,3 +1,13 @@
+2010-12-10  Brian Weinstein  <bweinstein@apple.com>
+
+        Reviewed by Ada Chan.
+
+        When we are creating a ContextMenuItem, only call setSubMenu if we have
+        a subMenu to set.
+
+        * platform/ContextMenuItem.cpp:
+        (WebCore::ContextMenuItem::ContextMenuItem):
+
 2010-12-10  Kenneth Russell  <kbr@google.com>
 
         Unreviewed, another build fix. #include <wtf/UnusedParam.h> needed
index bd321d9..0c2a6ea 100644 (file)
@@ -39,7 +39,8 @@ ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction act
     , m_enabled(true)
     , m_checked(false)
 {
-    setSubMenu(subMenu);
+    if (subMenu)
+        setSubMenu(subMenu);
 }
 
 ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction action, const String& title, bool enabled, bool checked)