{"action":"created","issue":{"url":"https://api.github.com/repos/highcharts/highcharts/issues/5116","repository_url":"https://api.github.com/repos/highcharts/highcharts","labels_url":"https://api.github.com/repos/highcharts/highcharts/issues/5116/labels{/name}","comments_url":"https://api.github.com/repos/highcharts/highcharts/issues/5116/comments","events_url":"https://api.github.com/repos/highcharts/highcharts/issues/5116/events","html_url":"https://github.com/highcharts/highcharts/issues/5116","id":140220847,"number":5116,"title":"Array.prototype.filter called on null or undefined","user":{"login":"adrianwilson","id":665000,"avatar_url":"https://avatars.githubusercontent.com/u/665000?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianwilson","html_url":"https://github.com/adrianwilson","followers_url":"https://api.github.com/users/adrianwilson/followers","following_url":"https://api.github.com/users/adrianwilson/following{/other_user}","gists_url":"https://api.github.com/users/adrianwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianwilson/subscriptions","organizations_url":"https://api.github.com/users/adrianwilson/orgs","repos_url":"https://api.github.com/users/adrianwilson/repos","events_url":"https://api.github.com/users/adrianwilson/events{/privacy}","received_events_url":"https://api.github.com/users/adrianwilson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/highcharts/highcharts/labels/Cant%20reproduce","name":"Cant reproduce","color":"078f17"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-11T15:57:49Z","updated_at":"2016-03-15T08:23:04Z","closed_at":"2016-03-15T08:23:04Z","body":"There seems to be a timing problem that mouse events are sometime captured after .destroy() is called. I am unable to sandbox the issue on jsfiddle, so am reaching out here to see if anyone else has run into this. If mouse events are captured after destroy getValidPoints calls grep with null this.points, and throws the following exception: `\"Uncaught TypeError: Array.prototype.filter called on null or undefined\"`.\r\n\r\n    getValidPoints: function (points) {\r\n\t    return grep(points || this.points, function (point) {\r\n\t\t  return !point.isNull;\r\n        });\r\n    }\r\n\r\nA proposed fix would be to add a null check to the grep method:\r\n\r\n    grep = function(elements, callback) {\r\n      //add following if condition\r\n      if (elements === undefined || elements === null) {\r\n        return;\r\n      }\r\n      return [].filter.call(elements, callback);\r\n    };\r\n\r\nHas anyone else run into this issue? Thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/highcharts/highcharts/issues/comments/196713107","html_url":"https://github.com/highcharts/highcharts/issues/5116#issuecomment-196713107","issue_url":"https://api.github.com/repos/highcharts/highcharts/issues/5116","id":196713107,"user":{"login":"TorsteinHonsi","id":227836,"avatar_url":"https://avatars.githubusercontent.com/u/227836?v=3","gravatar_id":"","url":"https://api.github.com/users/TorsteinHonsi","html_url":"https://github.com/TorsteinHonsi","followers_url":"https://api.github.com/users/TorsteinHonsi/followers","following_url":"https://api.github.com/users/TorsteinHonsi/following{/other_user}","gists_url":"https://api.github.com/users/TorsteinHonsi/gists{/gist_id}","starred_url":"https://api.github.com/users/TorsteinHonsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TorsteinHonsi/subscriptions","organizations_url":"https://api.github.com/users/TorsteinHonsi/orgs","repos_url":"https://api.github.com/users/TorsteinHonsi/repos","events_url":"https://api.github.com/users/TorsteinHonsi/events{/privacy}","received_events_url":"https://api.github.com/users/TorsteinHonsi/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T08:23:04Z","updated_at":"2016-03-15T08:23:04Z","body":"Looks like it's already fixed then, see https://github.com/highcharts/highcharts/blob/66e3599e/js/parts/Series.js#L803.\r\n\r\nI'm closing this, please reopen if you can reproduce the issue with the latest code from http://github.highcharts.com/highcharts.js."}}