{"action":"created","comment":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments/77007486","id":77007486,"diff_hunk":"@@ -117,26 +117,27 @@ void SaveDiffCal::writeIntFieldFromSVWS(\n     H5::Group &group, const std::string &name,\n     DataObjects::SpecialWorkspace2D_const_sptr ws) {\n   auto detidCol = m_calibrationWS->getColumn(\"detid\");\n-  bool isMask = bool(boost::dynamic_pointer_cast<const MaskWorkspace>(ws));\n+  const bool isMask = (name == \"use\");\n \n   // output array defaults to all one (one group, use the pixel)\n-  const int32_t DEFAULT_VALUE = (isMask ? 0 : 1);\n-  std::vector<int32_t> values(m_numValues, DEFAULT_VALUE);\n-\n-  int32_t value;\n-  for (size_t i = 0; i < m_numValues; ++i) {\n-    auto &ids = ws->getSpectrum(i).getDetectorIDs();\n-    auto found = m_detidToIndex.find(*(ids.begin()));\n-    if (found != m_detidToIndex.end()) {\n-      value = static_cast<int32_t>(ws->getValue(found->first));\n-      // in maskworkspace 0=use, 1=dontuse\n-      if (isMask) {\n-        if (value == 0)\n-          value = 1;\n-        else\n-          value = 0;\n+  std::vector<int32_t> values(m_numValues, 1);\n+\n+  if (bool(ws)) {\n+    int32_t value;\n+    for (size_t i = 0; i < m_numValues; ++i) {\n+      auto &ids = ws->getSpectrum(i).getDetectorIDs();\n+      auto found = m_detidToIndex.find(*(ids.begin()));\n+      if (found != m_detidToIndex.end()) {\n+        value = static_cast<int32_t>(ws->getValue(found->first));\n+        // in maskworkspace 0=use, 1=dontuse - backwards from the file\n+        if (isMask) {\n+          if (value == 0)\n+            value = 1;\n+          else\n+            value = 0;","path":"Framework/DataHandling/src/SaveDiffCal.cpp","position":37,"original_position":37,"commit_id":"5f6f35867ad499875c8327e08093b440ca691f47","original_commit_id":"5f6f35867ad499875c8327e08093b440ca691f47","user":{"login":"quantumsteve","id":5920552,"avatar_url":"https://avatars.githubusercontent.com/u/5920552?v=3","gravatar_id":"","url":"https://api.github.com/users/quantumsteve","html_url":"https://github.com/quantumsteve","followers_url":"https://api.github.com/users/quantumsteve/followers","following_url":"https://api.github.com/users/quantumsteve/following{/other_user}","gists_url":"https://api.github.com/users/quantumsteve/gists{/gist_id}","starred_url":"https://api.github.com/users/quantumsteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantumsteve/subscriptions","organizations_url":"https://api.github.com/users/quantumsteve/orgs","repos_url":"https://api.github.com/users/quantumsteve/repos","events_url":"https://api.github.com/users/quantumsteve/events{/privacy}","received_events_url":"https://api.github.com/users/quantumsteve/received_events","type":"User","site_admin":false},"body":"Oops, I had the logic backwards ( should it actually be `value = (value == 0)`? ). I think it's only a style difference and will merge whichever one you prefer. ","created_at":"2016-08-31T15:17:40Z","updated_at":"2016-08-31T15:17:40Z","html_url":"https://github.com/mantidproject/mantid/pull/17363#discussion_r77007486","pull_request_url":"https://api.github.com/repos/mantidproject/mantid/pulls/17363","_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments/77007486"},"html":{"href":"https://github.com/mantidproject/mantid/pull/17363#discussion_r77007486"},"pull_request":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/17363"}}},"pull_request":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/17363","id":83296845,"html_url":"https://github.com/mantidproject/mantid/pull/17363","diff_url":"https://github.com/mantidproject/mantid/pull/17363.diff","patch_url":"https://github.com/mantidproject/mantid/pull/17363.patch","issue_url":"https://api.github.com/repos/mantidproject/mantid/issues/17363","number":17363,"state":"open","locked":false,"title":"SaveDiffCal optional workspaces","user":{"login":"peterfpeterson","id":404003,"avatar_url":"https://avatars.githubusercontent.com/u/404003?v=3","gravatar_id":"","url":"https://api.github.com/users/peterfpeterson","html_url":"https://github.com/peterfpeterson","followers_url":"https://api.github.com/users/peterfpeterson/followers","following_url":"https://api.github.com/users/peterfpeterson/following{/other_user}","gists_url":"https://api.github.com/users/peterfpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/peterfpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterfpeterson/subscriptions","organizations_url":"https://api.github.com/users/peterfpeterson/orgs","repos_url":"https://api.github.com/users/peterfpeterson/repos","events_url":"https://api.github.com/users/peterfpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/peterfpeterson/received_events","type":"User","site_admin":false},"body":"The `MaskWorkspace` and `GroupingWorkspace` are not actually optional. If they are not supplied there is a null pointer de-reference that crashes mantid.\r\n\r\n**To test:**\r\n\r\nSince there are new unit tests that exercise the bug, just review the code and mark it :squirrel:\r\n\r\n*There is no associate issue*\r\n\r\n*Does not need to be in the release notes.*\r\n\r\n---\r\n\r\n#### Reviewer ####\r\n\r\nPlease comment on the following ([full description](http://www.mantidproject.org/Individual_Ticket_Testing)):\r\n\r\n##### Code Review #####\r\n\r\n- [x] Is the code of an acceptable quality?\r\n- [x] Does the code conform to the [coding standards](http://www.mantidproject.org/Coding_Standards)? Is it well structured with small focussed classes/methods/functions?\r\n- [x] Are there unit/system tests in place? Are the unit tests small and test the a class in isolation?\r\n- [x] If there are changes in the release notes then do they describe the changes appropriately?\r\n\r\n##### Functional Tests #####\r\n\r\n- [x] Do changes function as described? Add comments below that describe the tests performed?\r\n- [x] How do the changes handle unexpected situations, e.g. bad input?\r\n- [x] Has the relevant documentation been added/updated?\r\n- [x] Is user-facing documentation written in a user-friendly manner?\r\n- [x] Has developer documentation been updated if required?\r\n\r\n- Does everything look good? Comment with the ship it emoji but don't merge. A member of `@mantidproject/gatekeepers` will take care of it.\r\n","created_at":"2016-08-30T15:46:16Z","updated_at":"2016-08-31T15:17:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f50b93e952b4989e3f23a6ccd31b118ac8149788","assignee":{"login":"rosswhitfield","id":5595210,"avatar_url":"https://avatars.githubusercontent.com/u/5595210?v=3","gravatar_id":"","url":"https://api.github.com/users/rosswhitfield","html_url":"https://github.com/rosswhitfield","followers_url":"https://api.github.com/users/rosswhitfield/followers","following_url":"https://api.github.com/users/rosswhitfield/following{/other_user}","gists_url":"https://api.github.com/users/rosswhitfield/gists{/gist_id}","starred_url":"https://api.github.com/users/rosswhitfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosswhitfield/subscriptions","organizations_url":"https://api.github.com/users/rosswhitfield/orgs","repos_url":"https://api.github.com/users/rosswhitfield/repos","events_url":"https://api.github.com/users/rosswhitfield/events{/privacy}","received_events_url":"https://api.github.com/users/rosswhitfield/received_events","type":"User","site_admin":false},"assignees":[{"login":"rosswhitfield","id":5595210,"avatar_url":"https://avatars.githubusercontent.com/u/5595210?v=3","gravatar_id":"","url":"https://api.github.com/users/rosswhitfield","html_url":"https://github.com/rosswhitfield","followers_url":"https://api.github.com/users/rosswhitfield/followers","following_url":"https://api.github.com/users/rosswhitfield/following{/other_user}","gists_url":"https://api.github.com/users/rosswhitfield/gists{/gist_id}","starred_url":"https://api.github.com/users/rosswhitfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosswhitfield/subscriptions","organizations_url":"https://api.github.com/users/rosswhitfield/orgs","repos_url":"https://api.github.com/users/rosswhitfield/repos","events_url":"https://api.github.com/users/rosswhitfield/events{/privacy}","received_events_url":"https://api.github.com/users/rosswhitfield/received_events","type":"User","site_admin":false},{"login":"quantumsteve","id":5920552,"avatar_url":"https://avatars.githubusercontent.com/u/5920552?v=3","gravatar_id":"","url":"https://api.github.com/users/quantumsteve","html_url":"https://github.com/quantumsteve","followers_url":"https://api.github.com/users/quantumsteve/followers","following_url":"https://api.github.com/users/quantumsteve/following{/other_user}","gists_url":"https://api.github.com/users/quantumsteve/gists{/gist_id}","starred_url":"https://api.github.com/users/quantumsteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantumsteve/subscriptions","organizations_url":"https://api.github.com/users/quantumsteve/orgs","repos_url":"https://api.github.com/users/quantumsteve/repos","events_url":"https://api.github.com/users/quantumsteve/events{/privacy}","received_events_url":"https://api.github.com/users/quantumsteve/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mantidproject/mantid/milestones/58","html_url":"https://github.com/mantidproject/mantid/milestones/Release%203.8","labels_url":"https://api.github.com/repos/mantidproject/mantid/milestones/58/labels","id":1505614,"number":58,"title":"Release 3.8","description":"","creator":{"login":"granrothge","id":5910574,"avatar_url":"https://avatars.githubusercontent.com/u/5910574?v=3","gravatar_id":"","url":"https://api.github.com/users/granrothge","html_url":"https://github.com/granrothge","followers_url":"https://api.github.com/users/granrothge/followers","following_url":"https://api.github.com/users/granrothge/following{/other_user}","gists_url":"https://api.github.com/users/granrothge/gists{/gist_id}","starred_url":"https://api.github.com/users/granrothge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/granrothge/subscriptions","organizations_url":"https://api.github.com/users/granrothge/orgs","repos_url":"https://api.github.com/users/granrothge/repos","events_url":"https://api.github.com/users/granrothge/events{/privacy}","received_events_url":"https://api.github.com/users/granrothge/received_events","type":"User","site_admin":false},"open_issues":718,"closed_issues":721,"state":"open","created_at":"2016-01-13T20:00:53Z","updated_at":"2016-08-31T15:16:12Z","due_on":"2016-10-09T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mantidproject/mantid/pulls/17363/commits","review_comments_url":"https://api.github.com/repos/mantidproject/mantid/pulls/17363/comments","review_comment_url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/17363/comments","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/5f6f35867ad499875c8327e08093b440ca691f47","head":{"label":"mantidproject:SaveDiffCal_empty_mask","ref":"SaveDiffCal_empty_mask","sha":"5f6f35867ad499875c8327e08093b440ca691f47","user":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"repo":{"id":2594116,"name":"mantid","full_name":"mantidproject/mantid","owner":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mantidproject/mantid","description":"Main repository for Mantid code","fork":false,"url":"https://api.github.com/repos/mantidproject/mantid","forks_url":"https://api.github.com/repos/mantidproject/mantid/forks","keys_url":"https://api.github.com/repos/mantidproject/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantidproject/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantidproject/mantid/teams","hooks_url":"https://api.github.com/repos/mantidproject/mantid/hooks","issue_events_url":"https://api.github.com/repos/mantidproject/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mantidproject/mantid/events","assignees_url":"https://api.github.com/repos/mantidproject/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mantidproject/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mantidproject/mantid/tags","blobs_url":"https://api.github.com/repos/mantidproject/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantidproject/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantidproject/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantidproject/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mantidproject/mantid/languages","stargazers_url":"https://api.github.com/repos/mantidproject/mantid/stargazers","contributors_url":"https://api.github.com/repos/mantidproject/mantid/contributors","subscribers_url":"https://api.github.com/repos/mantidproject/mantid/subscribers","subscription_url":"https://api.github.com/repos/mantidproject/mantid/subscription","commits_url":"https://api.github.com/repos/mantidproject/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantidproject/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantidproject/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantidproject/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantidproject/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mantidproject/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantidproject/mantid/merges","archive_url":"https://api.github.com/repos/mantidproject/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantidproject/mantid/downloads","issues_url":"https://api.github.com/repos/mantidproject/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mantidproject/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mantidproject/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mantidproject/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantidproject/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mantidproject/mantid/releases{/id}","deployments_url":"https://api.github.com/repos/mantidproject/mantid/deployments","created_at":"2011-10-17T19:07:38Z","updated_at":"2016-08-22T07:35:41Z","pushed_at":"2016-08-31T15:17:25Z","git_url":"git://github.com/mantidproject/mantid.git","ssh_url":"git@github.com:mantidproject/mantid.git","clone_url":"https://github.com/mantidproject/mantid.git","svn_url":"https://github.com/mantidproject/mantid","homepage":"www.mantidproject.org","size":436450,"stargazers_count":47,"watchers_count":47,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":1646,"forks":37,"open_issues":1646,"watchers":47,"default_branch":"master"}},"base":{"label":"mantidproject:master","ref":"master","sha":"adabe9c92d3b45d8125c7d1bb5514552dd1e68b5","user":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"repo":{"id":2594116,"name":"mantid","full_name":"mantidproject/mantid","owner":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mantidproject/mantid","description":"Main repository for Mantid code","fork":false,"url":"https://api.github.com/repos/mantidproject/mantid","forks_url":"https://api.github.com/repos/mantidproject/mantid/forks","keys_url":"https://api.github.com/repos/mantidproject/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantidproject/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantidproject/mantid/teams","hooks_url":"https://api.github.com/repos/mantidproject/mantid/hooks","issue_events_url":"https://api.github.com/repos/mantidproject/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mantidproject/mantid/events","assignees_url":"https://api.github.com/repos/mantidproject/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mantidproject/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mantidproject/mantid/tags","blobs_url":"https://api.github.com/repos/mantidproject/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantidproject/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantidproject/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantidproject/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mantidproject/mantid/languages","stargazers_url":"https://api.github.com/repos/mantidproject/mantid/stargazers","contributors_url":"https://api.github.com/repos/mantidproject/mantid/contributors","subscribers_url":"https://api.github.com/repos/mantidproject/mantid/subscribers","subscription_url":"https://api.github.com/repos/mantidproject/mantid/subscription","commits_url":"https://api.github.com/repos/mantidproject/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantidproject/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantidproject/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantidproject/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantidproject/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mantidproject/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantidproject/mantid/merges","archive_url":"https://api.github.com/repos/mantidproject/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantidproject/mantid/downloads","issues_url":"https://api.github.com/repos/mantidproject/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mantidproject/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mantidproject/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mantidproject/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantidproject/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mantidproject/mantid/releases{/id}","deployments_url":"https://api.github.com/repos/mantidproject/mantid/deployments","created_at":"2011-10-17T19:07:38Z","updated_at":"2016-08-22T07:35:41Z","pushed_at":"2016-08-31T15:17:25Z","git_url":"git://github.com/mantidproject/mantid.git","ssh_url":"git@github.com:mantidproject/mantid.git","clone_url":"https://github.com/mantidproject/mantid.git","svn_url":"https://github.com/mantidproject/mantid","homepage":"www.mantidproject.org","size":436450,"stargazers_count":47,"watchers_count":47,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":1646,"forks":37,"open_issues":1646,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/17363"},"html":{"href":"https://github.com/mantidproject/mantid/pull/17363"},"issue":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/17363"},"comments":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/17363/comments"},"review_comments":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/17363/comments"},"review_comment":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/17363/commits"},"statuses":{"href":"https://api.github.com/repos/mantidproject/mantid/statuses/5f6f35867ad499875c8327e08093b440ca691f47"}}}}
{"actor":{"display_login":"quantumsteve"}}