Bug 143556

Summary: Exception in console and broken right click after attempting to show context menu in Inspector
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: WebKit2Assignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, bfulgham, commit-queue, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2015-04-08 22:27:24 PDT
* SUMMARY
When I run Safari and right click it produces an exception and right click stops working.

* STEPS TO REPRODUCE
1. Run Safari
2. Inspect a web page
3. Right click blank space in the navigation sidebar in the inspector
  => EXCEPTION in system console

Apr  8 21:37:35 pecoraro.apple.com Safari[81152] <Warning>: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Apr  8 21:37:35 pecoraro.apple.com Safari[81152] <Warning>: (
	0   CoreFoundation  __exceptionPreprocess + 172
	1   libobjc.A.dylib objc_exception_throw + 43
	2   CoreFoundation  -[__NSArrayM insertObject:atIndex:] + 1033
	3   AppKit          -[NSMenu insertItem:atIndex:] + 487
	4   WebKit          _ZN6WebKitL14populateNSMenuEP6NSMenuRKN3WTF6VectorINS2_9RetainPtrI10NSMenuItemEELm0ENS2_15CrashOnOverflowEEE + 94
	5   WebKit          _ZN6WebKit22WebContextMenuProxyMac8populateERKN3WTF6VectorINS1_6RefPtrINS_18WebContextMenuItemEEELm0ENS1_15CrashOnOverflowEEERKNS_22ContextMenuContextDataE + 465
...

* NOTES
- Seems to be a nil ContextMenu item, we should gracefully handle a null ContextMenuItem::shareMenuItem
Comment 1 Joseph Pecoraro 2015-04-08 22:27:50 PDT
<rdar://problem/20478205>
Comment 2 Joseph Pecoraro 2015-04-08 22:29:22 PDT
Created attachment 250417 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2015-04-08 22:31:58 PDT
Not sure how to write a test for this. Point me in the right direction and I'll give it a shot!
Comment 4 WebKit Commit Bot 2015-04-08 23:35:03 PDT
Comment on attachment 250417 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 250417

Committed r182590: <http://trac.webkit.org/changeset/182590>
Comment 5 WebKit Commit Bot 2015-04-08 23:35:07 PDT
All reviewed patches have been landed.  Closing bug.