Bug 29164 - INSOutlineViewDataSource.GetChildrenCount extension should allow null for item
Summary: INSOutlineViewDataSource.GetChildrenCount extension should allow null for item
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 2.0.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: 2.8.0 (C7)
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2015-04-16 15:17 UTC by Curtis Wensley
Modified: 2015-12-04 18:47 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Curtis Wensley 2015-04-16 15:17:01 UTC
Calling NSOutlineViewDataSource_Extensions.GetChildrenCount extension method throws an exception when the item passed in is null.  According to the docs here:

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSOutlineViewDataSource_Protocol/index.html#//apple_ref/occ/intfm/NSOutlineViewDataSource/outlineView:numberOfChildrenOfItem:

Passing in null for the item should get you the children of the top level item.
Comment 1 Chris Hamons 2015-04-16 15:18:42 UTC
Yep. We missed that one. We'll fix in 2.2 hopefully (too late for 2.0).

If you need a patch to get around this, let me know.
Comment 2 Curtis Wensley 2015-04-16 15:20:05 UTC
Looks like there's tons of other outlineView api's that do the same.. e.g. outlineView:child:ofItem:
Comment 3 Chris Hamons 2015-04-16 15:21:02 UTC
Noted. I'll do a scrub of that entire interface. Sometimes the headers don't note which APIs allow null and we miss cases like this.
Comment 4 Miguel de Icaza [MSFT] 2015-12-04 18:47:29 UTC
Fixed, the entire class has been audited