{"action":"closed","issue":{"url":"https://api.github.com/repos/samsteam/sams-core/issues/14","labels_url":"https://api.github.com/repos/samsteam/sams-core/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/samsteam/sams-core/issues/14/comments","events_url":"https://api.github.com/repos/samsteam/sams-core/issues/14/events","html_url":"https://github.com/samsteam/sams-core/issues/14","id":98836202,"number":14,"title":"_updatePolicies method is not taking care if _assignmentPolicies containing undefineds","user":{"login":"NatiiDC","id":11367767,"avatar_url":"https://avatars.githubusercontent.com/u/11367767?v=3","gravatar_id":"","url":"https://api.github.com/users/NatiiDC","html_url":"https://github.com/NatiiDC","followers_url":"https://api.github.com/users/NatiiDC/followers","following_url":"https://api.github.com/users/NatiiDC/following{/other_user}","gists_url":"https://api.github.com/users/NatiiDC/gists{/gist_id}","starred_url":"https://api.github.com/users/NatiiDC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NatiiDC/subscriptions","organizations_url":"https://api.github.com/users/NatiiDC/orgs","repos_url":"https://api.github.com/users/NatiiDC/repos","events_url":"https://api.github.com/users/NatiiDC/events{/privacy}","received_events_url":"https://api.github.com/users/NatiiDC/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-03T20:51:08Z","updated_at":"2015-08-03T21:08:53Z","closed_at":"2015-08-03T21:08:53Z","body":"Throws an exception when policy is undefined  \r\n`TypeError: Cannot read property 'update' of undefined`\r\n\r\n```javascript\r\nsetAsyncFlushReplacementPolicy: function(enabled) {\r\n    if (enabled === undefined) {\r\n      return;\r\n    }\r\n    if (this._algorithm && enabled) {\r\n      var policy = new AsyncFlushAssignmentPolicy()\r\n      this._assignmentPolicies[1] = policy;\r\n      this._algorithm.setAsyncFlushReplacementPolicy(true, policy);\r\n    } else {\r\n      this._assignmentPolicies[1] = undefined;     // <-- Here\r\n      this._algorithm.setAsyncFlushReplacementPolicy(false);\r\n    }\r\n\t},\r\n```\r\n\r\n```javascript\r\n_updatePolicies: function() {\r\n    this._assignmentPolicies.forEach(function(policy) {\r\n      policy.update(this._memory, this)     // <-- Here\r\n    }, this);\r\n  },\r\n```"}}