{"action":"created","issue":{"url":"https://api.github.com/repos/meteorhacks/flow-components/issues/34","labels_url":"https://api.github.com/repos/meteorhacks/flow-components/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/meteorhacks/flow-components/issues/34/comments","events_url":"https://api.github.com/repos/meteorhacks/flow-components/issues/34/events","html_url":"https://github.com/meteorhacks/flow-components/issues/34","id":72266963,"number":34,"title":"Return null/undefined from find() when the component isn't found","user":{"login":"pward123","id":2698435,"avatar_url":"https://avatars.githubusercontent.com/u/2698435?v=3","gravatar_id":"","url":"https://api.github.com/users/pward123","html_url":"https://github.com/pward123","followers_url":"https://api.github.com/users/pward123/followers","following_url":"https://api.github.com/users/pward123/following{/other_user}","gists_url":"https://api.github.com/users/pward123/gists{/gist_id}","starred_url":"https://api.github.com/users/pward123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pward123/subscriptions","organizations_url":"https://api.github.com/users/pward123/orgs","repos_url":"https://api.github.com/users/pward123/repos","events_url":"https://api.github.com/users/pward123/events{/privacy}","received_events_url":"https://api.github.com/users/pward123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-30T19:59:49Z","updated_at":"2015-05-04T11:58:16Z","closed_at":null,"body":"Is there a reason that FlowComponents.find() throws an exception when a component is not found?\r\n\r\nI have an existing project with modal dialog support that retrieves the template name to display from a session variable. I would like to add direct component support by doing something like:\r\n\r\n```html\r\n{{#if isComponentModal}}\r\n  {{> render component=template}}\r\n{{else}}\r\n  {{> template}}\r\n{{/if}}\r\n```\r\n\r\n```javascript\r\nModalDialog.helpers.isComponentModal = function() {\r\n  return FlowComponents.find(App.activeModalName());\r\n}\r\n\r\nModalDialog.helpers.template = function() {\r\n  return App.activeModalName();\r\n}\r\n```\r\n\r\nHowever, the find call is throw an error when the component is not found.  Obviously, I can just wrap the find call with a try/catch block, but it seems strange to have find() throw an error in the first place.\r\n"},"comment":{"url":"https://api.github.com/repos/meteorhacks/flow-components/issues/comments/98687079","html_url":"https://github.com/meteorhacks/flow-components/issues/34#issuecomment-98687079","issue_url":"https://api.github.com/repos/meteorhacks/flow-components/issues/34","id":98687079,"user":{"login":"pward123","id":2698435,"avatar_url":"https://avatars.githubusercontent.com/u/2698435?v=3","gravatar_id":"","url":"https://api.github.com/users/pward123","html_url":"https://github.com/pward123","followers_url":"https://api.github.com/users/pward123/followers","following_url":"https://api.github.com/users/pward123/following{/other_user}","gists_url":"https://api.github.com/users/pward123/gists{/gist_id}","starred_url":"https://api.github.com/users/pward123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pward123/subscriptions","organizations_url":"https://api.github.com/users/pward123/orgs","repos_url":"https://api.github.com/users/pward123/repos","events_url":"https://api.github.com/users/pward123/events{/privacy}","received_events_url":"https://api.github.com/users/pward123/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T11:58:16Z","updated_at":"2015-05-04T11:58:16Z","body":"Here's an example of what I'm talking about. I don't want the caller of openModal to know whether the modal is a component or template. Since the ComponentsStore is hidden, the only way to determine whether I'm dealing with a component is through find.\r\n\r\nhttp://meteorpad.com/pad/MDHM9w4uTiyms5MED/Modal%20Dialog%20Example"}}