Fix <rdar://problem/5344972> REGRESSION: A error dialog occurs when attempting to...
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jul 2007 08:40:58 +0000 (08:40 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jul 2007 08:40:58 +0000 (08:40 +0000)
Reviewed by Oliver.

* WebCoreSupport/WebContextMenuClient.mm:
(fixMenusToSendToOldClients): Don't check for the Inspect Element item
if we have fewer than 2 items.

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

WebKit/ChangeLog
WebKit/WebCoreSupport/WebContextMenuClient.mm

index b5fbfb395775e75bb4845c137f570395d6f20a3f..a168dfa822c693b5e79877f4f65fc60e07f94665 100644 (file)
@@ -1,3 +1,14 @@
+2007-07-19  Adam Roben  <aroben@apple.com>
+
+        Fix <rdar://problem/5344972> REGRESSION: A error dialog occurs when
+        attempting to ctrl-click in a iChat message window (webview)
+
+        Reviewed by Oliver.
+
+        * WebCoreSupport/WebContextMenuClient.mm:
+        (fixMenusToSendToOldClients): Don't check for the Inspect Element item
+        if we have fewer than 2 items.
+
 2007-07-18  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Dave Hyatt.
index d12a6626f7220496f96fa34a7c9a1d7eacb67f5f..b6ec273c07431d070ec7976b59c4e7abecaf978f 100644 (file)
@@ -83,7 +83,7 @@ static NSMutableArray *fixMenusToSendToOldClients(NSMutableArray *defaultMenuIte
 
     unsigned defaultItemsCount = [defaultMenuItems count];
 
-    if (isPreInspectElementTagClient()) {
+    if (isPreInspectElementTagClient() && defaultItemsCount >= 2) {
         NSMenuItem *secondToLastItem = [defaultMenuItems objectAtIndex:defaultItemsCount - 2];
         NSMenuItem *lastItem = [defaultMenuItems objectAtIndex:defaultItemsCount - 1];