{"action":"created","comment":{"url":"https://api.github.com/repos/freenas/gui/pulls/comments/80093546","id":80093546,"diff_hunk":"@@ -119,24 +119,28 @@ var ApplicationContextService = exports.ApplicationContextService = Montage.spec\n         }\n     },\n \n-    _handleRawApplicationContext: {\n+    _repairApplicationRawContextIfNeeded: {\n         value: function (applicationRawContext) {\n-            if (applicationRawContext) {\n-                // Repair applicationRawContext if needed\n-                if (!applicationRawContext.dashboardContext) {\n+            if (applicationRawContext) {                \n+                if (!applicationRawContext.dashboardContext && typeof applicationRawContext.dashboardContext !== \"object\") {\n                     applicationRawContext.dashboardContext = {};\n                 }\n \n-                if (!applicationRawContext.sideBoardContext) {\n+                if (!applicationRawContext.sideBoardContext && typeof applicationRawContext.sideBoardContext !== \"object\") {\n                     applicationRawContext.sideBoardContext = {};\n                 }\n \n-                if (!applicationRawContext.userSettings) {\n+                if (!applicationRawContext.userSettings && typeof applicationRawContext.userSettings !== \"object\") {\n                     applicationRawContext.userSettings = {};\n                 }\n \n-                applicationRawContext.dashboardContext.widgets = applicationRawContext.dashboardContext.widgets || [];\n-                applicationRawContext.sideBoardContext.widgets = applicationRawContext.sideBoardContext.widgets || [];\n+                if (!applicationRawContext.dashboardContext.widgets && !Array.isArray(applicationRawContext.dashboardContext.widgets)) {\n+                    applicationRawContext.dashboardContext.widgets = [];\n+                }\n+\n+                if (!applicationRawContext.sideBoardContext.widgets && !Array.isArray(applicationRawContext.sideBoardContext.widgets)) {","path":"core/service/application-context-service.js","position":115,"original_position":40,"commit_id":"5fcf0565247a0ea9b3d63af695570ef8b38a6c97","original_commit_id":"5fcf0565247a0ea9b3d63af695570ef8b38a6c97","user":{"login":"pchaussalet","id":161941,"avatar_url":"https://avatars.githubusercontent.com/u/161941?v=3","gravatar_id":"","url":"https://api.github.com/users/pchaussalet","html_url":"https://github.com/pchaussalet","followers_url":"https://api.github.com/users/pchaussalet/followers","following_url":"https://api.github.com/users/pchaussalet/following{/other_user}","gists_url":"https://api.github.com/users/pchaussalet/gists{/gist_id}","starred_url":"https://api.github.com/users/pchaussalet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pchaussalet/subscriptions","organizations_url":"https://api.github.com/users/pchaussalet/orgs","repos_url":"https://api.github.com/users/pchaussalet/repos","events_url":"https://api.github.com/users/pchaussalet/events{/privacy}","received_events_url":"https://api.github.com/users/pchaussalet/received_events","type":"User","site_admin":false},"body":"Shouldn't this be a OR (||) condition ?","created_at":"2016-09-22T17:31:42Z","updated_at":"2016-09-22T17:31:42Z","html_url":"https://github.com/freenas/gui/pull/82#discussion_r80093546","pull_request_url":"https://api.github.com/repos/freenas/gui/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/freenas/gui/pulls/comments/80093546"},"html":{"href":"https://github.com/freenas/gui/pull/82#discussion_r80093546"},"pull_request":{"href":"https://api.github.com/repos/freenas/gui/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/freenas/gui/pulls/82","id":86265234,"html_url":"https://github.com/freenas/gui/pull/82","diff_url":"https://github.com/freenas/gui/pull/82.diff","patch_url":"https://github.com/freenas/gui/pull/82.patch","issue_url":"https://api.github.com/repos/freenas/gui/issues/82","number":82,"state":"open","locked":false,"title":"Add UserSettings on application context.","user":{"login":"thibaultzanini","id":3347451,"avatar_url":"https://avatars.githubusercontent.com/u/3347451?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultzanini","html_url":"https://github.com/thibaultzanini","followers_url":"https://api.github.com/users/thibaultzanini/followers","following_url":"https://api.github.com/users/thibaultzanini/following{/other_user}","gists_url":"https://api.github.com/users/thibaultzanini/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultzanini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultzanini/subscriptions","organizations_url":"https://api.github.com/users/thibaultzanini/orgs","repos_url":"https://api.github.com/users/thibaultzanini/repos","events_url":"https://api.github.com/users/thibaultzanini/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultzanini/received_events","type":"User","site_admin":false},"body":"Ticket: #17670","created_at":"2016-09-22T00:44:46Z","updated_at":"2016-09-22T17:32:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db12a91d752aa7ecd457ed83f201d632aedc4e6d","assignee":{"login":"pchaussalet","id":161941,"avatar_url":"https://avatars.githubusercontent.com/u/161941?v=3","gravatar_id":"","url":"https://api.github.com/users/pchaussalet","html_url":"https://github.com/pchaussalet","followers_url":"https://api.github.com/users/pchaussalet/followers","following_url":"https://api.github.com/users/pchaussalet/following{/other_user}","gists_url":"https://api.github.com/users/pchaussalet/gists{/gist_id}","starred_url":"https://api.github.com/users/pchaussalet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pchaussalet/subscriptions","organizations_url":"https://api.github.com/users/pchaussalet/orgs","repos_url":"https://api.github.com/users/pchaussalet/repos","events_url":"https://api.github.com/users/pchaussalet/events{/privacy}","received_events_url":"https://api.github.com/users/pchaussalet/received_events","type":"User","site_admin":false},"assignees":[{"login":"pchaussalet","id":161941,"avatar_url":"https://avatars.githubusercontent.com/u/161941?v=3","gravatar_id":"","url":"https://api.github.com/users/pchaussalet","html_url":"https://github.com/pchaussalet","followers_url":"https://api.github.com/users/pchaussalet/followers","following_url":"https://api.github.com/users/pchaussalet/following{/other_user}","gists_url":"https://api.github.com/users/pchaussalet/gists{/gist_id}","starred_url":"https://api.github.com/users/pchaussalet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pchaussalet/subscriptions","organizations_url":"https://api.github.com/users/pchaussalet/orgs","repos_url":"https://api.github.com/users/pchaussalet/repos","events_url":"https://api.github.com/users/pchaussalet/events{/privacy}","received_events_url":"https://api.github.com/users/pchaussalet/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/freenas/gui/pulls/82/commits","review_comments_url":"https://api.github.com/repos/freenas/gui/pulls/82/comments","review_comment_url":"https://api.github.com/repos/freenas/gui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/freenas/gui/issues/82/comments","statuses_url":"https://api.github.com/repos/freenas/gui/statuses/5fcf0565247a0ea9b3d63af695570ef8b38a6c97","head":{"label":"thibaultzanini:api-application-context-serviec","ref":"api-application-context-serviec","sha":"5fcf0565247a0ea9b3d63af695570ef8b38a6c97","user":{"login":"thibaultzanini","id":3347451,"avatar_url":"https://avatars.githubusercontent.com/u/3347451?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultzanini","html_url":"https://github.com/thibaultzanini","followers_url":"https://api.github.com/users/thibaultzanini/followers","following_url":"https://api.github.com/users/thibaultzanini/following{/other_user}","gists_url":"https://api.github.com/users/thibaultzanini/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultzanini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultzanini/subscriptions","organizations_url":"https://api.github.com/users/thibaultzanini/orgs","repos_url":"https://api.github.com/users/thibaultzanini/repos","events_url":"https://api.github.com/users/thibaultzanini/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultzanini/received_events","type":"User","site_admin":false},"repo":{"id":49522426,"name":"gui","full_name":"thibaultzanini/gui","owner":{"login":"thibaultzanini","id":3347451,"avatar_url":"https://avatars.githubusercontent.com/u/3347451?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultzanini","html_url":"https://github.com/thibaultzanini","followers_url":"https://api.github.com/users/thibaultzanini/followers","following_url":"https://api.github.com/users/thibaultzanini/following{/other_user}","gists_url":"https://api.github.com/users/thibaultzanini/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultzanini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultzanini/subscriptions","organizations_url":"https://api.github.com/users/thibaultzanini/orgs","repos_url":"https://api.github.com/users/thibaultzanini/repos","events_url":"https://api.github.com/users/thibaultzanini/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultzanini/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thibaultzanini/gui","description":"New FreeNAS 10 GUI project","fork":true,"url":"https://api.github.com/repos/thibaultzanini/gui","forks_url":"https://api.github.com/repos/thibaultzanini/gui/forks","keys_url":"https://api.github.com/repos/thibaultzanini/gui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thibaultzanini/gui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thibaultzanini/gui/teams","hooks_url":"https://api.github.com/repos/thibaultzanini/gui/hooks","issue_events_url":"https://api.github.com/repos/thibaultzanini/gui/issues/events{/number}","events_url":"https://api.github.com/repos/thibaultzanini/gui/events","assignees_url":"https://api.github.com/repos/thibaultzanini/gui/assignees{/user}","branches_url":"https://api.github.com/repos/thibaultzanini/gui/branches{/branch}","tags_url":"https://api.github.com/repos/thibaultzanini/gui/tags","blobs_url":"https://api.github.com/repos/thibaultzanini/gui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thibaultzanini/gui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thibaultzanini/gui/git/refs{/sha}","trees_url":"https://api.github.com/repos/thibaultzanini/gui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thibaultzanini/gui/statuses/{sha}","languages_url":"https://api.github.com/repos/thibaultzanini/gui/languages","stargazers_url":"https://api.github.com/repos/thibaultzanini/gui/stargazers","contributors_url":"https://api.github.com/repos/thibaultzanini/gui/contributors","subscribers_url":"https://api.github.com/repos/thibaultzanini/gui/subscribers","subscription_url":"https://api.github.com/repos/thibaultzanini/gui/subscription","commits_url":"https://api.github.com/repos/thibaultzanini/gui/commits{/sha}","git_commits_url":"https://api.github.com/repos/thibaultzanini/gui/git/commits{/sha}","comments_url":"https://api.github.com/repos/thibaultzanini/gui/comments{/number}","issue_comment_url":"https://api.github.com/repos/thibaultzanini/gui/issues/comments{/number}","contents_url":"https://api.github.com/repos/thibaultzanini/gui/contents/{+path}","compare_url":"https://api.github.com/repos/thibaultzanini/gui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thibaultzanini/gui/merges","archive_url":"https://api.github.com/repos/thibaultzanini/gui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thibaultzanini/gui/downloads","issues_url":"https://api.github.com/repos/thibaultzanini/gui/issues{/number}","pulls_url":"https://api.github.com/repos/thibaultzanini/gui/pulls{/number}","milestones_url":"https://api.github.com/repos/thibaultzanini/gui/milestones{/number}","notifications_url":"https://api.github.com/repos/thibaultzanini/gui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thibaultzanini/gui/labels{/name}","releases_url":"https://api.github.com/repos/thibaultzanini/gui/releases{/id}","deployments_url":"https://api.github.com/repos/thibaultzanini/gui/deployments","created_at":"2016-01-12T19:04:28Z","updated_at":"2016-01-18T22:38:54Z","pushed_at":"2016-09-22T17:24:18Z","git_url":"git://github.com/thibaultzanini/gui.git","ssh_url":"git@github.com:thibaultzanini/gui.git","clone_url":"https://github.com/thibaultzanini/gui.git","svn_url":"https://github.com/thibaultzanini/gui","homepage":"http://freenas.github.io/gui","size":26639,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"montage"}},"base":{"label":"freenas:master","ref":"master","sha":"75f52a8c205f55824f13c466d24d2f77931a48b0","user":{"login":"freenas","id":3792476,"avatar_url":"https://avatars.githubusercontent.com/u/3792476?v=3","gravatar_id":"","url":"https://api.github.com/users/freenas","html_url":"https://github.com/freenas","followers_url":"https://api.github.com/users/freenas/followers","following_url":"https://api.github.com/users/freenas/following{/other_user}","gists_url":"https://api.github.com/users/freenas/gists{/gist_id}","starred_url":"https://api.github.com/users/freenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freenas/subscriptions","organizations_url":"https://api.github.com/users/freenas/orgs","repos_url":"https://api.github.com/users/freenas/repos","events_url":"https://api.github.com/users/freenas/events{/privacy}","received_events_url":"https://api.github.com/users/freenas/received_events","type":"Organization","site_admin":false},"repo":{"id":38790527,"name":"gui","full_name":"freenas/gui","owner":{"login":"freenas","id":3792476,"avatar_url":"https://avatars.githubusercontent.com/u/3792476?v=3","gravatar_id":"","url":"https://api.github.com/users/freenas","html_url":"https://github.com/freenas","followers_url":"https://api.github.com/users/freenas/followers","following_url":"https://api.github.com/users/freenas/following{/other_user}","gists_url":"https://api.github.com/users/freenas/gists{/gist_id}","starred_url":"https://api.github.com/users/freenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freenas/subscriptions","organizations_url":"https://api.github.com/users/freenas/orgs","repos_url":"https://api.github.com/users/freenas/repos","events_url":"https://api.github.com/users/freenas/events{/privacy}","received_events_url":"https://api.github.com/users/freenas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/freenas/gui","description":"New FreeNAS 10 GUI project","fork":false,"url":"https://api.github.com/repos/freenas/gui","forks_url":"https://api.github.com/repos/freenas/gui/forks","keys_url":"https://api.github.com/repos/freenas/gui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/freenas/gui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/freenas/gui/teams","hooks_url":"https://api.github.com/repos/freenas/gui/hooks","issue_events_url":"https://api.github.com/repos/freenas/gui/issues/events{/number}","events_url":"https://api.github.com/repos/freenas/gui/events","assignees_url":"https://api.github.com/repos/freenas/gui/assignees{/user}","branches_url":"https://api.github.com/repos/freenas/gui/branches{/branch}","tags_url":"https://api.github.com/repos/freenas/gui/tags","blobs_url":"https://api.github.com/repos/freenas/gui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/freenas/gui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/freenas/gui/git/refs{/sha}","trees_url":"https://api.github.com/repos/freenas/gui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/freenas/gui/statuses/{sha}","languages_url":"https://api.github.com/repos/freenas/gui/languages","stargazers_url":"https://api.github.com/repos/freenas/gui/stargazers","contributors_url":"https://api.github.com/repos/freenas/gui/contributors","subscribers_url":"https://api.github.com/repos/freenas/gui/subscribers","subscription_url":"https://api.github.com/repos/freenas/gui/subscription","commits_url":"https://api.github.com/repos/freenas/gui/commits{/sha}","git_commits_url":"https://api.github.com/repos/freenas/gui/git/commits{/sha}","comments_url":"https://api.github.com/repos/freenas/gui/comments{/number}","issue_comment_url":"https://api.github.com/repos/freenas/gui/issues/comments{/number}","contents_url":"https://api.github.com/repos/freenas/gui/contents/{+path}","compare_url":"https://api.github.com/repos/freenas/gui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/freenas/gui/merges","archive_url":"https://api.github.com/repos/freenas/gui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/freenas/gui/downloads","issues_url":"https://api.github.com/repos/freenas/gui/issues{/number}","pulls_url":"https://api.github.com/repos/freenas/gui/pulls{/number}","milestones_url":"https://api.github.com/repos/freenas/gui/milestones{/number}","notifications_url":"https://api.github.com/repos/freenas/gui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/freenas/gui/labels{/name}","releases_url":"https://api.github.com/repos/freenas/gui/releases{/id}","deployments_url":"https://api.github.com/repos/freenas/gui/deployments","created_at":"2015-07-09T01:52:52Z","updated_at":"2016-09-13T04:49:47Z","pushed_at":"2016-09-22T17:24:18Z","git_url":"git://github.com/freenas/gui.git","ssh_url":"git@github.com:freenas/gui.git","clone_url":"https://github.com/freenas/gui.git","svn_url":"https://github.com/freenas/gui","homepage":"http://freenas.github.io/gui","size":28180,"stargazers_count":49,"watchers_count":49,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":29,"mirror_url":null,"open_issues_count":6,"forks":29,"open_issues":6,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/freenas/gui/pulls/82"},"html":{"href":"https://github.com/freenas/gui/pull/82"},"issue":{"href":"https://api.github.com/repos/freenas/gui/issues/82"},"comments":{"href":"https://api.github.com/repos/freenas/gui/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/freenas/gui/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/freenas/gui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/freenas/gui/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/freenas/gui/statuses/5fcf0565247a0ea9b3d63af695570ef8b38a6c97"}}}}
{"actor":{"display_login":"pchaussalet"}}