{"action":"closed","number":181,"pull_request":{"url":"https://api.github.com/repos/edvin/tornadofx/pulls/181","id":85415587,"html_url":"https://github.com/edvin/tornadofx/pull/181","diff_url":"https://github.com/edvin/tornadofx/pull/181.diff","patch_url":"https://github.com/edvin/tornadofx/pull/181.patch","issue_url":"https://api.github.com/repos/edvin/tornadofx/issues/181","number":181,"state":"closed","locked":false,"title":"Fix exception of chooseFile with the mode Multi","user":{"login":"slimaku","id":2535178,"avatar_url":"https://avatars.githubusercontent.com/u/2535178?v=3","gravatar_id":"","url":"https://api.github.com/users/slimaku","html_url":"https://github.com/slimaku","followers_url":"https://api.github.com/users/slimaku/followers","following_url":"https://api.github.com/users/slimaku/following{/other_user}","gists_url":"https://api.github.com/users/slimaku/gists{/gist_id}","starred_url":"https://api.github.com/users/slimaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimaku/subscriptions","organizations_url":"https://api.github.com/users/slimaku/orgs","repos_url":"https://api.github.com/users/slimaku/repos","events_url":"https://api.github.com/users/slimaku/events{/privacy}","received_events_url":"https://api.github.com/users/slimaku/received_events","type":"User","site_admin":false},"body":"Hello, \r\n\r\nI encountered a bug when using TornadoFX at work. So I propose a fix for it.\r\n\r\nWith the function `chooseFile()` in the mode `FileChooserMode.Multi` there can be an exception if the user click on \"cancel\" in the dialog.\r\n\r\n## Exemple :\r\n```kotlin\r\nclass MyView : View() {\r\n    override val root = hbox()\r\n}\r\n\r\nclass MyApp : App(MyView::class) {\r\n    init {\r\n        chooseFile(filters = emptyArray(), mode = FileChooserMode.Multi)\r\n    }\r\n}\r\n```\r\n\r\nIf in the file chooser dialog if you click \"cancel\" this exception will be thrown :\r\n```\r\njava.lang.IllegalStateException: chooser.showOpenMultipleDialog(owner) must not be null\r\n\tat tornadofx.DialogsKt.chooseFile(Dialogs.kt:50)\r\n\tat tornadofx.DialogsKt.chooseFile$default(Dialogs.kt:40)\r\n       ...\r\n```\r\n\r\n## Solution\r\nI added `?: emptyList()` at the end of  `chooser.showOpenMultipleDialog(owner)` to ensure an empty list whould be return in the case of a null result.","created_at":"2016-09-15T14:32:17Z","updated_at":"2016-09-15T15:50:58Z","closed_at":"2016-09-15T15:50:58Z","merged_at":"2016-09-15T15:50:58Z","merge_commit_sha":"2f571d160f3a9838c1ad96e959db7353d74662b2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/edvin/tornadofx/pulls/181/commits","review_comments_url":"https://api.github.com/repos/edvin/tornadofx/pulls/181/comments","review_comment_url":"https://api.github.com/repos/edvin/tornadofx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edvin/tornadofx/issues/181/comments","statuses_url":"https://api.github.com/repos/edvin/tornadofx/statuses/678817af57410c0428d940c87b81d92b37842cdf","head":{"label":"slimaku:fix/npe_on_cancel_of_filechoosermode_multi","ref":"fix/npe_on_cancel_of_filechoosermode_multi","sha":"678817af57410c0428d940c87b81d92b37842cdf","user":{"login":"slimaku","id":2535178,"avatar_url":"https://avatars.githubusercontent.com/u/2535178?v=3","gravatar_id":"","url":"https://api.github.com/users/slimaku","html_url":"https://github.com/slimaku","followers_url":"https://api.github.com/users/slimaku/followers","following_url":"https://api.github.com/users/slimaku/following{/other_user}","gists_url":"https://api.github.com/users/slimaku/gists{/gist_id}","starred_url":"https://api.github.com/users/slimaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimaku/subscriptions","organizations_url":"https://api.github.com/users/slimaku/orgs","repos_url":"https://api.github.com/users/slimaku/repos","events_url":"https://api.github.com/users/slimaku/events{/privacy}","received_events_url":"https://api.github.com/users/slimaku/received_events","type":"User","site_admin":false},"repo":{"id":67682816,"name":"tornadofx","full_name":"slimaku/tornadofx","owner":{"login":"slimaku","id":2535178,"avatar_url":"https://avatars.githubusercontent.com/u/2535178?v=3","gravatar_id":"","url":"https://api.github.com/users/slimaku","html_url":"https://github.com/slimaku","followers_url":"https://api.github.com/users/slimaku/followers","following_url":"https://api.github.com/users/slimaku/following{/other_user}","gists_url":"https://api.github.com/users/slimaku/gists{/gist_id}","starred_url":"https://api.github.com/users/slimaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimaku/subscriptions","organizations_url":"https://api.github.com/users/slimaku/orgs","repos_url":"https://api.github.com/users/slimaku/repos","events_url":"https://api.github.com/users/slimaku/events{/privacy}","received_events_url":"https://api.github.com/users/slimaku/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slimaku/tornadofx","description":"Lightweight JavaFX Framework for Kotlin","fork":true,"url":"https://api.github.com/repos/slimaku/tornadofx","forks_url":"https://api.github.com/repos/slimaku/tornadofx/forks","keys_url":"https://api.github.com/repos/slimaku/tornadofx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slimaku/tornadofx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slimaku/tornadofx/teams","hooks_url":"https://api.github.com/repos/slimaku/tornadofx/hooks","issue_events_url":"https://api.github.com/repos/slimaku/tornadofx/issues/events{/number}","events_url":"https://api.github.com/repos/slimaku/tornadofx/events","assignees_url":"https://api.github.com/repos/slimaku/tornadofx/assignees{/user}","branches_url":"https://api.github.com/repos/slimaku/tornadofx/branches{/branch}","tags_url":"https://api.github.com/repos/slimaku/tornadofx/tags","blobs_url":"https://api.github.com/repos/slimaku/tornadofx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slimaku/tornadofx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slimaku/tornadofx/git/refs{/sha}","trees_url":"https://api.github.com/repos/slimaku/tornadofx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slimaku/tornadofx/statuses/{sha}","languages_url":"https://api.github.com/repos/slimaku/tornadofx/languages","stargazers_url":"https://api.github.com/repos/slimaku/tornadofx/stargazers","contributors_url":"https://api.github.com/repos/slimaku/tornadofx/contributors","subscribers_url":"https://api.github.com/repos/slimaku/tornadofx/subscribers","subscription_url":"https://api.github.com/repos/slimaku/tornadofx/subscription","commits_url":"https://api.github.com/repos/slimaku/tornadofx/commits{/sha}","git_commits_url":"https://api.github.com/repos/slimaku/tornadofx/git/commits{/sha}","comments_url":"https://api.github.com/repos/slimaku/tornadofx/comments{/number}","issue_comment_url":"https://api.github.com/repos/slimaku/tornadofx/issues/comments{/number}","contents_url":"https://api.github.com/repos/slimaku/tornadofx/contents/{+path}","compare_url":"https://api.github.com/repos/slimaku/tornadofx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slimaku/tornadofx/merges","archive_url":"https://api.github.com/repos/slimaku/tornadofx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slimaku/tornadofx/downloads","issues_url":"https://api.github.com/repos/slimaku/tornadofx/issues{/number}","pulls_url":"https://api.github.com/repos/slimaku/tornadofx/pulls{/number}","milestones_url":"https://api.github.com/repos/slimaku/tornadofx/milestones{/number}","notifications_url":"https://api.github.com/repos/slimaku/tornadofx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slimaku/tornadofx/labels{/name}","releases_url":"https://api.github.com/repos/slimaku/tornadofx/releases{/id}","deployments_url":"https://api.github.com/repos/slimaku/tornadofx/deployments","created_at":"2016-09-08T08:12:16Z","updated_at":"2016-09-08T08:12:17Z","pushed_at":"2016-09-15T14:06:59Z","git_url":"git://github.com/slimaku/tornadofx.git","ssh_url":"git@github.com:slimaku/tornadofx.git","clone_url":"https://github.com/slimaku/tornadofx.git","svn_url":"https://github.com/slimaku/tornadofx","homepage":"","size":1500,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"edvin:master","ref":"master","sha":"3387fddb99cf7c7b0ecac924fb8ae8e2a539e809","user":{"login":"edvin","id":977035,"avatar_url":"https://avatars.githubusercontent.com/u/977035?v=3","gravatar_id":"","url":"https://api.github.com/users/edvin","html_url":"https://github.com/edvin","followers_url":"https://api.github.com/users/edvin/followers","following_url":"https://api.github.com/users/edvin/following{/other_user}","gists_url":"https://api.github.com/users/edvin/gists{/gist_id}","starred_url":"https://api.github.com/users/edvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edvin/subscriptions","organizations_url":"https://api.github.com/users/edvin/orgs","repos_url":"https://api.github.com/users/edvin/repos","events_url":"https://api.github.com/users/edvin/events{/privacy}","received_events_url":"https://api.github.com/users/edvin/received_events","type":"User","site_admin":false},"repo":{"id":49143977,"name":"tornadofx","full_name":"edvin/tornadofx","owner":{"login":"edvin","id":977035,"avatar_url":"https://avatars.githubusercontent.com/u/977035?v=3","gravatar_id":"","url":"https://api.github.com/users/edvin","html_url":"https://github.com/edvin","followers_url":"https://api.github.com/users/edvin/followers","following_url":"https://api.github.com/users/edvin/following{/other_user}","gists_url":"https://api.github.com/users/edvin/gists{/gist_id}","starred_url":"https://api.github.com/users/edvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edvin/subscriptions","organizations_url":"https://api.github.com/users/edvin/orgs","repos_url":"https://api.github.com/users/edvin/repos","events_url":"https://api.github.com/users/edvin/events{/privacy}","received_events_url":"https://api.github.com/users/edvin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edvin/tornadofx","description":"Lightweight JavaFX Framework for Kotlin","fork":false,"url":"https://api.github.com/repos/edvin/tornadofx","forks_url":"https://api.github.com/repos/edvin/tornadofx/forks","keys_url":"https://api.github.com/repos/edvin/tornadofx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edvin/tornadofx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edvin/tornadofx/teams","hooks_url":"https://api.github.com/repos/edvin/tornadofx/hooks","issue_events_url":"https://api.github.com/repos/edvin/tornadofx/issues/events{/number}","events_url":"https://api.github.com/repos/edvin/tornadofx/events","assignees_url":"https://api.github.com/repos/edvin/tornadofx/assignees{/user}","branches_url":"https://api.github.com/repos/edvin/tornadofx/branches{/branch}","tags_url":"https://api.github.com/repos/edvin/tornadofx/tags","blobs_url":"https://api.github.com/repos/edvin/tornadofx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edvin/tornadofx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edvin/tornadofx/git/refs{/sha}","trees_url":"https://api.github.com/repos/edvin/tornadofx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edvin/tornadofx/statuses/{sha}","languages_url":"https://api.github.com/repos/edvin/tornadofx/languages","stargazers_url":"https://api.github.com/repos/edvin/tornadofx/stargazers","contributors_url":"https://api.github.com/repos/edvin/tornadofx/contributors","subscribers_url":"https://api.github.com/repos/edvin/tornadofx/subscribers","subscription_url":"https://api.github.com/repos/edvin/tornadofx/subscription","commits_url":"https://api.github.com/repos/edvin/tornadofx/commits{/sha}","git_commits_url":"https://api.github.com/repos/edvin/tornadofx/git/commits{/sha}","comments_url":"https://api.github.com/repos/edvin/tornadofx/comments{/number}","issue_comment_url":"https://api.github.com/repos/edvin/tornadofx/issues/comments{/number}","contents_url":"https://api.github.com/repos/edvin/tornadofx/contents/{+path}","compare_url":"https://api.github.com/repos/edvin/tornadofx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edvin/tornadofx/merges","archive_url":"https://api.github.com/repos/edvin/tornadofx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edvin/tornadofx/downloads","issues_url":"https://api.github.com/repos/edvin/tornadofx/issues{/number}","pulls_url":"https://api.github.com/repos/edvin/tornadofx/pulls{/number}","milestones_url":"https://api.github.com/repos/edvin/tornadofx/milestones{/number}","notifications_url":"https://api.github.com/repos/edvin/tornadofx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edvin/tornadofx/labels{/name}","releases_url":"https://api.github.com/repos/edvin/tornadofx/releases{/id}","deployments_url":"https://api.github.com/repos/edvin/tornadofx/deployments","created_at":"2016-01-06T15:38:14Z","updated_at":"2016-09-10T07:10:16Z","pushed_at":"2016-09-15T15:50:58Z","git_url":"git://github.com/edvin/tornadofx.git","ssh_url":"git@github.com:edvin/tornadofx.git","clone_url":"https://github.com/edvin/tornadofx.git","svn_url":"https://github.com/edvin/tornadofx","homepage":"","size":1549,"stargazers_count":233,"watchers_count":233,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":7,"forks":24,"open_issues":7,"watchers":233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edvin/tornadofx/pulls/181"},"html":{"href":"https://github.com/edvin/tornadofx/pull/181"},"issue":{"href":"https://api.github.com/repos/edvin/tornadofx/issues/181"},"comments":{"href":"https://api.github.com/repos/edvin/tornadofx/issues/181/comments"},"review_comments":{"href":"https://api.github.com/repos/edvin/tornadofx/pulls/181/comments"},"review_comment":{"href":"https://api.github.com/repos/edvin/tornadofx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edvin/tornadofx/pulls/181/commits"},"statuses":{"href":"https://api.github.com/repos/edvin/tornadofx/statuses/678817af57410c0428d940c87b81d92b37842cdf"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"edvin","id":977035,"avatar_url":"https://avatars.githubusercontent.com/u/977035?v=3","gravatar_id":"","url":"https://api.github.com/users/edvin","html_url":"https://github.com/edvin","followers_url":"https://api.github.com/users/edvin/followers","following_url":"https://api.github.com/users/edvin/following{/other_user}","gists_url":"https://api.github.com/users/edvin/gists{/gist_id}","starred_url":"https://api.github.com/users/edvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edvin/subscriptions","organizations_url":"https://api.github.com/users/edvin/orgs","repos_url":"https://api.github.com/users/edvin/repos","events_url":"https://api.github.com/users/edvin/events{/privacy}","received_events_url":"https://api.github.com/users/edvin/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"edvin"}}