{"action":"opened","issue":{"url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/58","labels_url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/58/comments","events_url":"https://api.github.com/repos/leekelleher/umbraco-ditto/issues/58/events","html_url":"https://github.com/leekelleher/umbraco-ditto/issues/58","id":66329538,"number":58,"title":"MultiNodeTreePickerConverter<T> throws when passed an empty string","user":{"login":"akatakritos","id":3689068,"avatar_url":"https://avatars.githubusercontent.com/u/3689068?v=3","gravatar_id":"","url":"https://api.github.com/users/akatakritos","html_url":"https://github.com/akatakritos","followers_url":"https://api.github.com/users/akatakritos/followers","following_url":"https://api.github.com/users/akatakritos/following{/other_user}","gists_url":"https://api.github.com/users/akatakritos/gists{/gist_id}","starred_url":"https://api.github.com/users/akatakritos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akatakritos/subscriptions","organizations_url":"https://api.github.com/users/akatakritos/orgs","repos_url":"https://api.github.com/users/akatakritos/repos","events_url":"https://api.github.com/users/akatakritos/events{/privacy}","received_events_url":"https://api.github.com/users/akatakritos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-04T15:12:47Z","updated_at":"2015-04-04T15:12:47Z","closed_at":null,"body":"This pertains to Umbraco 7.2.4 and Ditto 0.6.1\r\n\r\nHello! I've been playing with integrating Ditto into a test project and ran into an issue when using the MultiNodeTreePickerConverter: it would throw when passed an empty string, which I believe happens when the user hadn't selected any content.\r\n\r\n```\r\npublic class Event : BasePage\r\n {\r\n    public Event(IPublishedContent content) : base(content)\r\n    {\r\n    }\r\n\r\n    public DateTime StartTime { get; set; }\r\n    public DateTime EndTime { get; set; }\r\n    public string EventName { get; set; }\r\n    public string EventDescription { get; set; }\r\n\r\n    [TypeConverter(typeof(MultiNodeTreePickerConverter<Location>))]\r\n    [UmbracoProperty(\"location\")]\r\n    public IEnumerable<Location> Locations { get; set; }\r\n}\r\n```\r\n\r\nI would get a NotSupported exception if the user didn't select any locations in the back office. \r\n\r\nI fixed it by subclassing:\r\n\r\n```\r\npublic class AllowEmptyMultiNodeTreePickerConverter<T> : MultiNodeTreePickerConverter<T> where T:class\r\n{\r\n    public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)\r\n    {\r\n        if (value is string && value.Equals(\"\"))\r\n        {\r\n            return Enumerable.Empty<T>();\r\n        }\r\n\r\n        return base.ConvertFrom(context, culture, value);\r\n    }\r\n}\r\n```\r\n\r\nAnd using that type as the TypeConverter in the attribute.\r\n\r\nLooking at the code, `MultiNodeTreePickerConverter` returns an empty enumerable if passed a null to convert. \r\n\r\nAm I using this attribute incorrectly?\r\n\r\nIf not, I was wondering if you were interested in a PR that treated empty string the same?\r\n\r\nThanks for your time!"}}