{"action":"created","comment":{"url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/comments/169997944","pull_request_review_id":98612098,"id":169997944,"diff_hunk":"@@ -216,6 +216,10 @@ function createWindow() {\n   mainWindow = new BrowserWindow(windowOptions);\n \n   function captureAndSaveWindowStats() {\n+    if (!mainWindow) {\n+      return;\n+    }","path":"main.js","position":6,"original_position":6,"commit_id":"5ac411d7e3d99a6cdd9ff7fd76266bd1ac4515da","original_commit_id":"5ac411d7e3d99a6cdd9ff7fd76266bd1ac4515da","user":{"login":"gasi","id":49583,"avatar_url":"https://avatars3.githubusercontent.com/u/49583?v=4","gravatar_id":"","url":"https://api.github.com/users/gasi","html_url":"https://github.com/gasi","followers_url":"https://api.github.com/users/gasi/followers","following_url":"https://api.github.com/users/gasi/following{/other_user}","gists_url":"https://api.github.com/users/gasi/gists{/gist_id}","starred_url":"https://api.github.com/users/gasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gasi/subscriptions","organizations_url":"https://api.github.com/users/gasi/orgs","repos_url":"https://api.github.com/users/gasi/repos","events_url":"https://api.github.com/users/gasi/events{/privacy}","received_events_url":"https://api.github.com/users/gasi/received_events","type":"User","site_admin":false},"body":"Thanks for sharing that snippet, I must have missed it. At some point, it might make sense to remove all event handlers that rely on `mainWindow` to be set so we’re a bit more explicit about the lifecycle of the app.","created_at":"2018-02-22T15:40:17Z","updated_at":"2018-02-22T15:40:17Z","html_url":"https://github.com/signalapp/Signal-Desktop/pull/2061#discussion_r169997944","pull_request_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2061","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/comments/169997944"},"html":{"href":"https://github.com/signalapp/Signal-Desktop/pull/2061#discussion_r169997944"},"pull_request":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2061"}},"in_reply_to_id":169761078},"pull_request":{"url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2061","id":170540008,"html_url":"https://github.com/signalapp/Signal-Desktop/pull/2061","diff_url":"https://github.com/signalapp/Signal-Desktop/pull/2061.diff","patch_url":"https://github.com/signalapp/Signal-Desktop/pull/2061.patch","issue_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/2061","number":2061,"state":"closed","locked":false,"title":"Protect against null mainWindow in captureAndSaveWindowStats","user":{"login":"scottnonnenberg","id":443005,"avatar_url":"https://avatars2.githubusercontent.com/u/443005?v=4","gravatar_id":"","url":"https://api.github.com/users/scottnonnenberg","html_url":"https://github.com/scottnonnenberg","followers_url":"https://api.github.com/users/scottnonnenberg/followers","following_url":"https://api.github.com/users/scottnonnenberg/following{/other_user}","gists_url":"https://api.github.com/users/scottnonnenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/scottnonnenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottnonnenberg/subscriptions","organizations_url":"https://api.github.com/users/scottnonnenberg/orgs","repos_url":"https://api.github.com/users/scottnonnenberg/repos","events_url":"https://api.github.com/users/scottnonnenberg/events{/privacy}","received_events_url":"https://api.github.com/users/scottnonnenberg/received_events","type":"User","site_admin":false},"body":"Fixes #2059","created_at":"2018-02-21T17:39:05Z","updated_at":"2018-02-22T15:40:17Z","closed_at":"2018-02-21T22:18:05Z","merged_at":"2018-02-21T22:18:05Z","merge_commit_sha":"06a16baaa56af51e27d5931b5716f4a82bf5bf6a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2061/commits","review_comments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2061/comments","review_comment_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/2061/comments","statuses_url":"https://api.github.com/repos/signalapp/Signal-Desktop/statuses/5ac411d7e3d99a6cdd9ff7fd76266bd1ac4515da","head":{"label":"signalapp:protect-null","ref":"protect-null","sha":"5ac411d7e3d99a6cdd9ff7fd76266bd1ac4515da","user":{"login":"signalapp","id":702459,"avatar_url":"https://avatars2.githubusercontent.com/u/702459?v=4","gravatar_id":"","url":"https://api.github.com/users/signalapp","html_url":"https://github.com/signalapp","followers_url":"https://api.github.com/users/signalapp/followers","following_url":"https://api.github.com/users/signalapp/following{/other_user}","gists_url":"https://api.github.com/users/signalapp/gists{/gist_id}","starred_url":"https://api.github.com/users/signalapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalapp/subscriptions","organizations_url":"https://api.github.com/users/signalapp/orgs","repos_url":"https://api.github.com/users/signalapp/repos","events_url":"https://api.github.com/users/signalapp/events{/privacy}","received_events_url":"https://api.github.com/users/signalapp/received_events","type":"Organization","site_admin":false},"repo":{"id":17148588,"name":"Signal-Desktop","full_name":"signalapp/Signal-Desktop","owner":{"login":"signalapp","id":702459,"avatar_url":"https://avatars2.githubusercontent.com/u/702459?v=4","gravatar_id":"","url":"https://api.github.com/users/signalapp","html_url":"https://github.com/signalapp","followers_url":"https://api.github.com/users/signalapp/followers","following_url":"https://api.github.com/users/signalapp/following{/other_user}","gists_url":"https://api.github.com/users/signalapp/gists{/gist_id}","starred_url":"https://api.github.com/users/signalapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalapp/subscriptions","organizations_url":"https://api.github.com/users/signalapp/orgs","repos_url":"https://api.github.com/users/signalapp/repos","events_url":"https://api.github.com/users/signalapp/events{/privacy}","received_events_url":"https://api.github.com/users/signalapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalapp/Signal-Desktop","description":"Signal Private Messenger for Windows, Mac, and Linux","fork":false,"url":"https://api.github.com/repos/signalapp/Signal-Desktop","forks_url":"https://api.github.com/repos/signalapp/Signal-Desktop/forks","keys_url":"https://api.github.com/repos/signalapp/Signal-Desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalapp/Signal-Desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalapp/Signal-Desktop/teams","hooks_url":"https://api.github.com/repos/signalapp/Signal-Desktop/hooks","issue_events_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/events{/number}","events_url":"https://api.github.com/repos/signalapp/Signal-Desktop/events","assignees_url":"https://api.github.com/repos/signalapp/Signal-Desktop/assignees{/user}","branches_url":"https://api.github.com/repos/signalapp/Signal-Desktop/branches{/branch}","tags_url":"https://api.github.com/repos/signalapp/Signal-Desktop/tags","blobs_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalapp/Signal-Desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/signalapp/Signal-Desktop/languages","stargazers_url":"https://api.github.com/repos/signalapp/Signal-Desktop/stargazers","contributors_url":"https://api.github.com/repos/signalapp/Signal-Desktop/contributors","subscribers_url":"https://api.github.com/repos/signalapp/Signal-Desktop/subscribers","subscription_url":"https://api.github.com/repos/signalapp/Signal-Desktop/subscription","commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/signalapp/Signal-Desktop/contents/{+path}","compare_url":"https://api.github.com/repos/signalapp/Signal-Desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalapp/Signal-Desktop/merges","archive_url":"https://api.github.com/repos/signalapp/Signal-Desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalapp/Signal-Desktop/downloads","issues_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues{/number}","pulls_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/signalapp/Signal-Desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/signalapp/Signal-Desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalapp/Signal-Desktop/labels{/name}","releases_url":"https://api.github.com/repos/signalapp/Signal-Desktop/releases{/id}","deployments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/deployments","created_at":"2014-02-24T19:53:36Z","updated_at":"2018-02-22T15:36:18Z","pushed_at":"2018-02-22T02:05:05Z","git_url":"git://github.com/signalapp/Signal-Desktop.git","ssh_url":"git@github.com:signalapp/Signal-Desktop.git","clone_url":"https://github.com/signalapp/Signal-Desktop.git","svn_url":"https://github.com/signalapp/Signal-Desktop","homepage":"https://signal.org/download","size":54022,"stargazers_count":3080,"watchers_count":3080,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":545,"mirror_url":null,"archived":false,"open_issues_count":331,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":545,"open_issues":331,"watchers":3080,"default_branch":"development"}},"base":{"label":"signalapp:development","ref":"development","sha":"a0da73ca8d60d59b4687e60e44f85bca4ef58b07","user":{"login":"signalapp","id":702459,"avatar_url":"https://avatars2.githubusercontent.com/u/702459?v=4","gravatar_id":"","url":"https://api.github.com/users/signalapp","html_url":"https://github.com/signalapp","followers_url":"https://api.github.com/users/signalapp/followers","following_url":"https://api.github.com/users/signalapp/following{/other_user}","gists_url":"https://api.github.com/users/signalapp/gists{/gist_id}","starred_url":"https://api.github.com/users/signalapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalapp/subscriptions","organizations_url":"https://api.github.com/users/signalapp/orgs","repos_url":"https://api.github.com/users/signalapp/repos","events_url":"https://api.github.com/users/signalapp/events{/privacy}","received_events_url":"https://api.github.com/users/signalapp/received_events","type":"Organization","site_admin":false},"repo":{"id":17148588,"name":"Signal-Desktop","full_name":"signalapp/Signal-Desktop","owner":{"login":"signalapp","id":702459,"avatar_url":"https://avatars2.githubusercontent.com/u/702459?v=4","gravatar_id":"","url":"https://api.github.com/users/signalapp","html_url":"https://github.com/signalapp","followers_url":"https://api.github.com/users/signalapp/followers","following_url":"https://api.github.com/users/signalapp/following{/other_user}","gists_url":"https://api.github.com/users/signalapp/gists{/gist_id}","starred_url":"https://api.github.com/users/signalapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signalapp/subscriptions","organizations_url":"https://api.github.com/users/signalapp/orgs","repos_url":"https://api.github.com/users/signalapp/repos","events_url":"https://api.github.com/users/signalapp/events{/privacy}","received_events_url":"https://api.github.com/users/signalapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/signalapp/Signal-Desktop","description":"Signal Private Messenger for Windows, Mac, and Linux","fork":false,"url":"https://api.github.com/repos/signalapp/Signal-Desktop","forks_url":"https://api.github.com/repos/signalapp/Signal-Desktop/forks","keys_url":"https://api.github.com/repos/signalapp/Signal-Desktop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/signalapp/Signal-Desktop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/signalapp/Signal-Desktop/teams","hooks_url":"https://api.github.com/repos/signalapp/Signal-Desktop/hooks","issue_events_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/events{/number}","events_url":"https://api.github.com/repos/signalapp/Signal-Desktop/events","assignees_url":"https://api.github.com/repos/signalapp/Signal-Desktop/assignees{/user}","branches_url":"https://api.github.com/repos/signalapp/Signal-Desktop/branches{/branch}","tags_url":"https://api.github.com/repos/signalapp/Signal-Desktop/tags","blobs_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/refs{/sha}","trees_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/signalapp/Signal-Desktop/statuses/{sha}","languages_url":"https://api.github.com/repos/signalapp/Signal-Desktop/languages","stargazers_url":"https://api.github.com/repos/signalapp/Signal-Desktop/stargazers","contributors_url":"https://api.github.com/repos/signalapp/Signal-Desktop/contributors","subscribers_url":"https://api.github.com/repos/signalapp/Signal-Desktop/subscribers","subscription_url":"https://api.github.com/repos/signalapp/Signal-Desktop/subscription","commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/commits{/sha}","git_commits_url":"https://api.github.com/repos/signalapp/Signal-Desktop/git/commits{/sha}","comments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/comments{/number}","issue_comment_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/comments{/number}","contents_url":"https://api.github.com/repos/signalapp/Signal-Desktop/contents/{+path}","compare_url":"https://api.github.com/repos/signalapp/Signal-Desktop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/signalapp/Signal-Desktop/merges","archive_url":"https://api.github.com/repos/signalapp/Signal-Desktop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/signalapp/Signal-Desktop/downloads","issues_url":"https://api.github.com/repos/signalapp/Signal-Desktop/issues{/number}","pulls_url":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls{/number}","milestones_url":"https://api.github.com/repos/signalapp/Signal-Desktop/milestones{/number}","notifications_url":"https://api.github.com/repos/signalapp/Signal-Desktop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/signalapp/Signal-Desktop/labels{/name}","releases_url":"https://api.github.com/repos/signalapp/Signal-Desktop/releases{/id}","deployments_url":"https://api.github.com/repos/signalapp/Signal-Desktop/deployments","created_at":"2014-02-24T19:53:36Z","updated_at":"2018-02-22T15:36:18Z","pushed_at":"2018-02-22T02:05:05Z","git_url":"git://github.com/signalapp/Signal-Desktop.git","ssh_url":"git@github.com:signalapp/Signal-Desktop.git","clone_url":"https://github.com/signalapp/Signal-Desktop.git","svn_url":"https://github.com/signalapp/Signal-Desktop","homepage":"https://signal.org/download","size":54022,"stargazers_count":3080,"watchers_count":3080,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":545,"mirror_url":null,"archived":false,"open_issues_count":331,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":545,"open_issues":331,"watchers":3080,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2061"},"html":{"href":"https://github.com/signalapp/Signal-Desktop/pull/2061"},"issue":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/2061"},"comments":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/issues/2061/comments"},"review_comments":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2061/comments"},"review_comment":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/pulls/2061/commits"},"statuses":{"href":"https://api.github.com/repos/signalapp/Signal-Desktop/statuses/5ac411d7e3d99a6cdd9ff7fd76266bd1ac4515da"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"gasi"}}