{"action":"opened","number":7031,"pull_request":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/7031","id":81137048,"html_url":"https://github.com/DynamoDS/Dynamo/pull/7031","diff_url":"https://github.com/DynamoDS/Dynamo/pull/7031.diff","patch_url":"https://github.com/DynamoDS/Dynamo/pull/7031.patch","issue_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/7031","number":7031,"state":"open","locked":false,"title":"Fix random crash in preview control","user":{"login":"sharadkjaiswal","id":1754137,"avatar_url":"https://avatars.githubusercontent.com/u/1754137?v=3","gravatar_id":"","url":"https://api.github.com/users/sharadkjaiswal","html_url":"https://github.com/sharadkjaiswal","followers_url":"https://api.github.com/users/sharadkjaiswal/followers","following_url":"https://api.github.com/users/sharadkjaiswal/following{/other_user}","gists_url":"https://api.github.com/users/sharadkjaiswal/gists{/gist_id}","starred_url":"https://api.github.com/users/sharadkjaiswal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharadkjaiswal/subscriptions","organizations_url":"https://api.github.com/users/sharadkjaiswal/orgs","repos_url":"https://api.github.com/users/sharadkjaiswal/repos","events_url":"https://api.github.com/users/sharadkjaiswal/events{/privacy}","received_events_url":"https://api.github.com/users/sharadkjaiswal/received_events","type":"User","site_admin":false},"body":"### Purpose\r\n\r\nThis PR fixes some of the crashes caused by refreshing preview control. It potentially fixes [MAGN-9932](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-9932), [MAGN-10531](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-10531) and [MAGN-10528](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-10528)\r\n\r\n- When `GenerateWatchViewModelForData` async task throws any exception newViewModel is not set properly and hence while accessing it in `AsyncTaskCompletedHandler delegate` it throws `NullReferenceException`. Fixed by an early return when the newViewModel is null.\r\n- Sometimes `DivideByZeroException` is thrown from `ComputeLargeContentSize` method while calling `UpdateLayout`. Used Try-catch to catch this exception and set the content size as default condensed content.\r\n\r\n### Declarations\r\n\r\nCheck these if you believe they are true\r\n\r\n- [ ] The code base is in a better state after this PR\r\n- [ ] Is documented according to the [standards](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards)\r\n- [ ] The level of testing this PR includes is appropriate\r\n- [ ] User facing strings, if any, are extracted into `*.resx` files\r\n- [ ] All tests pass using the self-service CI.\r\n- [ ] Snapshot of UI changes, if any.\r\n\r\n### Reviewers\r\n\r\n@ke-yu \r\n\r\n### FYIs\r\n\r\n@monikaprabhu \r\n\r\n","created_at":"2016-08-12T15:23:17Z","updated_at":"2016-08-12T15:23:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/7031/commits","review_comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/7031/comments","review_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/7031/comments","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/e41513a70461d229ab4d83aa81b82065cb09dfd7","head":{"label":"Conceptual-Design:previewcontrol","ref":"previewcontrol","sha":"e41513a70461d229ab4d83aa81b82065cb09dfd7","user":{"login":"Conceptual-Design","id":1738955,"avatar_url":"https://avatars.githubusercontent.com/u/1738955?v=3","gravatar_id":"","url":"https://api.github.com/users/Conceptual-Design","html_url":"https://github.com/Conceptual-Design","followers_url":"https://api.github.com/users/Conceptual-Design/followers","following_url":"https://api.github.com/users/Conceptual-Design/following{/other_user}","gists_url":"https://api.github.com/users/Conceptual-Design/gists{/gist_id}","starred_url":"https://api.github.com/users/Conceptual-Design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Conceptual-Design/subscriptions","organizations_url":"https://api.github.com/users/Conceptual-Design/orgs","repos_url":"https://api.github.com/users/Conceptual-Design/repos","events_url":"https://api.github.com/users/Conceptual-Design/events{/privacy}","received_events_url":"https://api.github.com/users/Conceptual-Design/received_events","type":"Organization","site_admin":false},"repo":{"id":24040432,"name":"Dynamo","full_name":"Conceptual-Design/Dynamo","owner":{"login":"Conceptual-Design","id":1738955,"avatar_url":"https://avatars.githubusercontent.com/u/1738955?v=3","gravatar_id":"","url":"https://api.github.com/users/Conceptual-Design","html_url":"https://github.com/Conceptual-Design","followers_url":"https://api.github.com/users/Conceptual-Design/followers","following_url":"https://api.github.com/users/Conceptual-Design/following{/other_user}","gists_url":"https://api.github.com/users/Conceptual-Design/gists{/gist_id}","starred_url":"https://api.github.com/users/Conceptual-Design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Conceptual-Design/subscriptions","organizations_url":"https://api.github.com/users/Conceptual-Design/orgs","repos_url":"https://api.github.com/users/Conceptual-Design/repos","events_url":"https://api.github.com/users/Conceptual-Design/events{/privacy}","received_events_url":"https://api.github.com/users/Conceptual-Design/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Conceptual-Design/Dynamo","description":"Visual Programming For Revit","fork":true,"url":"https://api.github.com/repos/Conceptual-Design/Dynamo","forks_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/forks","keys_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/teams","hooks_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/events","assignees_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/tags","blobs_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/languages","stargazers_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/subscription","commits_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/merges","archive_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/downloads","issues_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/releases{/id}","deployments_url":"https://api.github.com/repos/Conceptual-Design/Dynamo/deployments","created_at":"2014-09-15T02:50:33Z","updated_at":"2016-01-25T02:05:05Z","pushed_at":"2016-08-12T15:09:58Z","git_url":"git://github.com/Conceptual-Design/Dynamo.git","ssh_url":"git@github.com:Conceptual-Design/Dynamo.git","clone_url":"https://github.com/Conceptual-Design/Dynamo.git","svn_url":"https://github.com/Conceptual-Design/Dynamo","homepage":"http://dynamobim.org","size":936824,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"DynamoDS:master","ref":"master","sha":"d9adf2daa66a16f05f5888dfcc3ff0182b77a29c","user":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"repo":{"id":3395179,"name":"Dynamo","full_name":"DynamoDS/Dynamo","owner":{"login":"DynamoDS","id":6528209,"avatar_url":"https://avatars.githubusercontent.com/u/6528209?v=3","gravatar_id":"","url":"https://api.github.com/users/DynamoDS","html_url":"https://github.com/DynamoDS","followers_url":"https://api.github.com/users/DynamoDS/followers","following_url":"https://api.github.com/users/DynamoDS/following{/other_user}","gists_url":"https://api.github.com/users/DynamoDS/gists{/gist_id}","starred_url":"https://api.github.com/users/DynamoDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DynamoDS/subscriptions","organizations_url":"https://api.github.com/users/DynamoDS/orgs","repos_url":"https://api.github.com/users/DynamoDS/repos","events_url":"https://api.github.com/users/DynamoDS/events{/privacy}","received_events_url":"https://api.github.com/users/DynamoDS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DynamoDS/Dynamo","description":"Visual Programming","fork":false,"url":"https://api.github.com/repos/DynamoDS/Dynamo","forks_url":"https://api.github.com/repos/DynamoDS/Dynamo/forks","keys_url":"https://api.github.com/repos/DynamoDS/Dynamo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DynamoDS/Dynamo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DynamoDS/Dynamo/teams","hooks_url":"https://api.github.com/repos/DynamoDS/Dynamo/hooks","issue_events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/events{/number}","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/events","assignees_url":"https://api.github.com/repos/DynamoDS/Dynamo/assignees{/user}","branches_url":"https://api.github.com/repos/DynamoDS/Dynamo/branches{/branch}","tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/tags","blobs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/{sha}","languages_url":"https://api.github.com/repos/DynamoDS/Dynamo/languages","stargazers_url":"https://api.github.com/repos/DynamoDS/Dynamo/stargazers","contributors_url":"https://api.github.com/repos/DynamoDS/Dynamo/contributors","subscribers_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscribers","subscription_url":"https://api.github.com/repos/DynamoDS/Dynamo/subscription","commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DynamoDS/Dynamo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DynamoDS/Dynamo/contents/{+path}","compare_url":"https://api.github.com/repos/DynamoDS/Dynamo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DynamoDS/Dynamo/merges","archive_url":"https://api.github.com/repos/DynamoDS/Dynamo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DynamoDS/Dynamo/downloads","issues_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues{/number}","pulls_url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls{/number}","milestones_url":"https://api.github.com/repos/DynamoDS/Dynamo/milestones{/number}","notifications_url":"https://api.github.com/repos/DynamoDS/Dynamo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/labels{/name}","releases_url":"https://api.github.com/repos/DynamoDS/Dynamo/releases{/id}","deployments_url":"https://api.github.com/repos/DynamoDS/Dynamo/deployments","created_at":"2012-02-09T07:35:33Z","updated_at":"2016-08-03T21:21:08Z","pushed_at":"2016-08-12T07:53:24Z","git_url":"git://github.com/DynamoDS/Dynamo.git","ssh_url":"git@github.com:DynamoDS/Dynamo.git","clone_url":"https://github.com/DynamoDS/Dynamo.git","svn_url":"https://github.com/DynamoDS/Dynamo","homepage":"http://dynamobim.org","size":1171958,"stargazers_count":369,"watchers_count":369,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":256,"mirror_url":null,"open_issues_count":636,"forks":256,"open_issues":636,"watchers":369,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/7031"},"html":{"href":"https://github.com/DynamoDS/Dynamo/pull/7031"},"issue":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/7031"},"comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/issues/7031/comments"},"review_comments":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/7031/comments"},"review_comment":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/7031/commits"},"statuses":{"href":"https://api.github.com/repos/DynamoDS/Dynamo/statuses/e41513a70461d229ab4d83aa81b82065cb09dfd7"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":50,"deletions":33,"changed_files":1}}
{"actor":{"display_login":"sharadkjaiswal"}}