Skip to content

Commit

Permalink
Merge pull request #2991 from tiagoroldao/issue-2990
Browse files Browse the repository at this point in the history
Check for existence of data element before accessing property
  • Loading branch information
etimberg authored Jul 18, 2016
2 parents 7930137 + 9df06e8 commit 41ec60f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/core.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,10 @@ module.exports = function(Chart) {

helpers.each(me.data.datasets, function(dataset, datasetIndex) {
if (me.isDatasetVisible(datasetIndex)) {
var meta = me.getDatasetMeta(datasetIndex);
if(!meta.data[found._index]._view.skip){
elementsArray.push(meta.data[found._index]);
var meta = me.getDatasetMeta(datasetIndex),
element = meta.data[found._index];
if(element && !element._view.skip){
elementsArray.push(element);
}
}
}, me);
Expand Down

0 comments on commit 41ec60f

Please sign in to comment.